<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">

<title>class DEBUGGER__::Session - debug: Ruby Standard Library Documentation</title>


<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<script src="../js/jquery-3.2.0.min.js"></script>

<script src="../js/vue.min.js"></script>
<script src="../js/js.cookie.min.js"></script>

<link href="../css/fonts.css" rel="stylesheet">
<link id='rdoccss' href="../css/rdoc.css" rel="stylesheet">
<link href="../css/carbon17.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
  var darkModeCsseHref = "../css/rdoc-dm.css"
  var defaultModeCssHref = "../css/rdoc.css"
  // var cssDarkmode = Cookies.get('darkmode');
  
  if( Cookies.get("darkmode") == "true") {
	$('#rdoccss').attr("href", darkModeCsseHref);
}

//  https://cssdeck.com/blog/simple-jquery-stylesheet-switcher/

document.write('<style type="text/css">body{display:none}</style>');

</script>


</head>
<body id="top" role="document" class="class">
  <!-- this is class.html -->

  <div id='actionbar' >
    <div class='wrapper mdiv'>
      <ul class='grids g0'></ul>
    </div> 
    <!-- VERSION HEADER for 3.3.0.preview2 NOT FOUND -->
  </div> <!-- end action bar -->

  <div class='wrapper hdiv'>

    


    <nav id='vapp' role="navigation">
    <div id="project-navigation">
      <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2><a href="../index.html" rel="home">Home</a></h2>

  <div id="table-of-contents-navigation"  >
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

      <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

    </div>


    

    <button id='toggleThing' @click="toggleNav()" >Show/hide navigation</button>
    <div :class="isOpen ? 'block' : 'hidden' " id='toggleMe'>
      <div id="class-metadata">
        
        
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link"><a href="../Object.html">Object</a>
</div>

        
<div id="includes-section" class="nav-section">
  <h3>Included Modules</h3>

  <ul class="link-list">
    <li><a class="include" href="GlobalVariablesHelper.html">DEBUGGER__::GlobalVariablesHelper</a>
    <li><a class="include" href="Color.html">DEBUGGER__::Color</a>
  </ul>
</div>

        
        
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li ><a href="#method-c-activate_method_added_trackers">::activate_method_added_trackers</a>
    <li ><a href="#method-c-create_method_added_tracker">::create_method_added_tracker</a>
    <li ><a href="#method-c-deactivate_method_added_trackers">::deactivate_method_added_trackers</a>
    <li ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-activate">#activate</a>
    <li ><a href="#method-i-active-3F">#active?</a>
    <li ><a href="#method-i-add_bp">#add_bp</a>
    <li ><a href="#method-i-add_catch_breakpoint">#add_catch_breakpoint</a>
    <li ><a href="#method-i-add_check_breakpoint">#add_check_breakpoint</a>
    <li ><a href="#method-i-add_iseq_breakpoint">#add_iseq_breakpoint</a>
    <li ><a href="#method-i-add_line_breakpoint">#add_line_breakpoint</a>
    <li ><a href="#method-i-add_preset_commands">#add_preset_commands</a>
    <li ><a href="#method-i-add_tracer">#add_tracer</a>
    <li ><a href="#method-i-after_fork_parent">#after_fork_parent</a>
    <li ><a href="#method-i-ask">#ask</a>
    <li ><a href="#method-i-ask_thread_client">#ask_thread_client</a>
    <li ><a href="#method-i-before_fork">#before_fork</a>
    <li ><a href="#method-i-bp_index">#bp_index</a>
    <li ><a href="#method-i-cancel_auto_continue">#cancel_auto_continue</a>
    <li ><a href="#method-i-capture_exception_frames">#capture_exception_frames</a>
    <li ><a href="#method-i-check_postmortem">#check_postmortem</a>
    <li ><a href="#method-i-check_unsafe">#check_unsafe</a>
    <li ><a href="#method-i-clean_bps">#clean_bps</a>
    <li ><a href="#method-i-clear_all_breakpoints">#clear_all_breakpoints</a>
    <li ><a href="#method-i-clear_breakpoints">#clear_breakpoints</a>
    <li ><a href="#method-i-clear_catch_breakpoints">#clear_catch_breakpoints</a>
    <li ><a href="#method-i-clear_line_breakpoints">#clear_line_breakpoints</a>
    <li ><a href="#method-i-config_command">#config_command</a>
    <li ><a href="#method-i-config_set">#config_set</a>
    <li ><a href="#method-i-config_show">#config_show</a>
    <li ><a href="#method-i-create_thread_client">#create_thread_client</a>
    <li ><a href="#method-i-deactivate">#deactivate</a>
    <li ><a href="#method-i-delete_bp">#delete_bp</a>
    <li ><a href="#method-i-enter_postmortem_session">#enter_postmortem_session</a>
    <li ><a href="#method-i-enter_subsession">#enter_subsession</a>
    <li ><a href="#method-i-extend_feature">#extend_feature</a>
    <li ><a href="#method-i-fail_response">#fail_response</a>
    <li ><a href="#method-i-find_waiting_tc">#find_waiting_tc</a>
    <li ><a href="#method-i-get_thread_client">#get_thread_client</a>
    <li ><a href="#method-i-get_type">#get_type</a>
    <li ><a href="#method-i-in_subsession-3F">#in_subsession?</a>
    <li ><a href="#method-i-inspect">#inspect</a>
    <li ><a href="#method-i-intercept_trap_sigint">#intercept_trap_sigint</a>
    <li ><a href="#method-i-intercept_trap_sigint-3F">#intercept_trap_sigint?</a>
    <li ><a href="#method-i-intercept_trap_sigint_end">#intercept_trap_sigint_end</a>
    <li ><a href="#method-i-intercept_trap_sigint_start">#intercept_trap_sigint_start</a>
    <li ><a href="#method-i-iterate_bps">#iterate_bps</a>
    <li ><a href="#method-i-leave_subsession">#leave_subsession</a>
    <li ><a href="#method-i-managed_thread_clients">#managed_thread_clients</a>
    <li ><a href="#method-i-method_added">#method_added</a>
    <li ><a href="#method-i-on_load">#on_load</a>
    <li ><a href="#method-i-on_thread_begin">#on_thread_begin</a>
    <li ><a href="#method-i-parse_break">#parse_break</a>
    <li ><a href="#method-i-pop_event">#pop_event</a>
    <li ><a href="#method-i-postmortem-3D">#postmortem=</a>
    <li ><a href="#method-i-process_command">#process_command</a>
    <li ><a href="#method-i-process_event">#process_event</a>
    <li ><a href="#method-i-process_info">#process_info</a>
    <li ><a href="#method-i-process_protocol_request">#process_protocol_request</a>
    <li ><a href="#method-i-process_protocol_result">#process_protocol_result</a>
    <li ><a href="#method-i-prompt">#prompt</a>
    <li ><a href="#method-i-register_command">#register_command</a>
    <li ><a href="#method-i-register_default_command">#register_default_command</a>
    <li ><a href="#method-i-register_var">#register_var</a>
    <li ><a href="#method-i-register_vars">#register_vars</a>
    <li ><a href="#method-i-rehash_bps">#rehash_bps</a>
    <li ><a href="#method-i-remote-3F">#remote?</a>
    <li ><a href="#method-i-repl_add_breakpoint">#repl_add_breakpoint</a>
    <li ><a href="#method-i-repl_add_catch_breakpoint">#repl_add_catch_breakpoint</a>
    <li ><a href="#method-i-repl_add_watch_breakpoint">#repl_add_watch_breakpoint</a>
    <li ><a href="#method-i-request_eval">#request_eval</a>
    <li ><a href="#method-i-request_tc">#request_tc</a>
    <li ><a href="#method-i-reset_ui">#reset_ui</a>
    <li ><a href="#method-i-resolve_path">#resolve_path</a>
    <li ><a href="#method-i-restart_all_threads">#restart_all_threads</a>
    <li ><a href="#method-i-running_thread_clients_count">#running_thread_clients_count</a>
    <li ><a href="#method-i-save_int_trap">#save_int_trap</a>
    <li ><a href="#method-i-session_server_main">#session_server_main</a>
    <li ><a href="#method-i-set_no_sigint_hook">#set_no_sigint_hook</a>
    <li ><a href="#method-i-setup_threads">#setup_threads</a>
    <li ><a href="#method-i-show_bps">#show_bps</a>
    <li ><a href="#method-i-show_help">#show_help</a>
    <li ><a href="#method-i-source">#source</a>
    <li ><a href="#method-i-step_command">#step_command</a>
    <li ><a href="#method-i-stop_all_threads">#stop_all_threads</a>
    <li ><a href="#method-i-stop_stepping-3F">#stop_stepping?</a>
    <li ><a href="#method-i-switch_thread">#switch_thread</a>
    <li ><a href="#method-i-thread_list">#thread_list</a>
    <li ><a href="#method-i-thread_stopper">#thread_stopper</a>
    <li ><a href="#method-i-update_thread_list">#update_thread_list</a>
    <li ><a href="#method-i-wait_command">#wait_command</a>
    <li ><a href="#method-i-wait_command_loop">#wait_command_loop</a>
    <li ><a href="#method-i-waiting_thread_clients">#waiting_thread_clients</a>
    <li ><a href="#method-i-width">#width</a>
  </ul>
</div>

      </div>
     </div>
    </nav>


    <div id='extraz'><div class='adzbox-index'  >
      
     </div>         
    </div>

    <main role="main" aria-labelledby="class-DEBUGGER__::Session">
    <h1 id="class-DEBUGGER__::Session" class="class">
      class DEBUGGER__::Session
    </h1>

    <section class="description">
    
    </section>

      <section id="5Buntitled-5D" class="documentation-section">


      <section class="constants-list">
      <header>
      <h3>Constants</h3>
      </header>
      <dl>
          <dt id="BREAK_KEYWORDS">BREAK_KEYWORDS
          <dd>
          <dt id="INTERNAL_ERROR">INTERNAL_ERROR
          <dd>
          <dt id="INVALID_PARAMS">INVALID_PARAMS
          <dd>
          <dt id="METHOD_ADDED_TRACKERS">METHOD_ADDED_TRACKERS
          <dd>
        </dl>
        </section>

        <section class="attribute-method-details" class="method-section">
        <header>
        <h3>Attributes</h3>
        </header>

          <div id="attribute-i-intercepted_sigint_cmd" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">intercepted_sigint_cmd</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-process_group" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">process_group</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
          <div id="attribute-i-subsession_id" class="method-detail">
            <div class="method-heading attribute-method-heading">
              <span class="method-name">subsession_id</span><span
                class="attribute-access-type">[R]</span>
            </div>

            <div class="method-description">
              
              </div>
            </div>
            </section>


                <section id="public-class-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Class Methods</h3>
                </header>

                  <div id="method-c-activate_method_added_trackers" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">activate_method_added_trackers</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="activate_method_added_trackers-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1829</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">activate_method_added_trackers</span>
  <span class="ruby-constant">METHOD_ADDED_TRACKERS</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">m</span>, <span class="ruby-identifier">tp</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">enable</span>(<span class="ruby-value">target:</span> <span class="ruby-identifier">m</span>) <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">enabled?</span>
  <span class="ruby-keyword">rescue</span> <span class="ruby-constant">ArgumentError</span>
    <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">warn</span> <span class="ruby-node">&quot;Methods defined under #{m.owner} can not track by the debugger.&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-create_method_added_tracker" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">create_method_added_tracker</span><span
                                class="method-args">(mod, method_added_id, method_accessor = :method)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="create_method_added_tracker-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1822</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">create_method_added_tracker</span> <span class="ruby-identifier">mod</span>, <span class="ruby-identifier">method_added_id</span>, <span class="ruby-identifier">method_accessor</span> = <span class="ruby-value">:method</span>
  <span class="ruby-identifier">m</span> = <span class="ruby-identifier">mod</span>.<span class="ruby-identifier">__send__</span>(<span class="ruby-identifier">method_accessor</span>, <span class="ruby-identifier">method_added_id</span>)
  <span class="ruby-constant">METHOD_ADDED_TRACKERS</span>[<span class="ruby-identifier">m</span>] = <span class="ruby-constant">TracePoint</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:call</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tp</span><span class="ruby-operator">|</span>
    <span class="ruby-constant">SESSION</span>.<span class="ruby-identifier">method_added</span> <span class="ruby-identifier">tp</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-deactivate_method_added_trackers" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">deactivate_method_added_trackers</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="deactivate_method_added_trackers-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1837</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier ruby-title">deactivate_method_added_trackers</span>
  <span class="ruby-constant">METHOD_ADDED_TRACKERS</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">m</span>, <span class="ruby-identifier">tp</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">disable</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">enabled?</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-c-new" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">new</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 98</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>
  <span class="ruby-ivar">@ui</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@sr</span> = <span class="ruby-constant">SourceRepository</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-ivar">@bps</span> = {} <span class="ruby-comment"># bp.key =&gt; bp</span>
            <span class="ruby-comment">#   [file, line] =&gt; LineBreakpoint</span>
            <span class="ruby-comment">#   &quot;Error&quot; =&gt; CatchBreakpoint</span>
            <span class="ruby-comment">#   &quot;Foo#bar&quot; =&gt; MethodBreakpoint</span>
            <span class="ruby-comment">#   [:watch, ivar] =&gt; WatchIVarBreakpoint</span>
            <span class="ruby-comment">#   [:check, expr] =&gt; CheckBreakpoint</span>
  <span class="ruby-comment">#</span>
  <span class="ruby-ivar">@tracers</span> = {}
  <span class="ruby-ivar">@th_clients</span> = {} <span class="ruby-comment"># {Thread =&gt; ThreadClient}</span>
  <span class="ruby-ivar">@q_evt</span> = <span class="ruby-constant">Queue</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-ivar">@displays</span> = []
  <span class="ruby-ivar">@tc</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@tc_id</span> = <span class="ruby-value">0</span>
  <span class="ruby-ivar">@preset_command</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@postmortem_hook</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@postmortem</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@intercept_trap_sigint</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@intercepted_sigint_cmd</span> = <span class="ruby-string">&#39;DEFAULT&#39;</span>
  <span class="ruby-ivar">@process_group</span> = <span class="ruby-constant">ProcessGroup</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-ivar">@subsession_stack</span> = []
  <span class="ruby-ivar">@subsession_id</span> = <span class="ruby-value">0</span>

  <span class="ruby-ivar">@frame_map</span> = {} <span class="ruby-comment"># for DAP: {id =&gt; [threadId, frame_depth]} and CDP: {id =&gt; frame_depth}</span>
  <span class="ruby-ivar">@var_map</span>   = {<span class="ruby-value">1</span> <span class="ruby-operator">=&gt;</span> [<span class="ruby-value">:globals</span>], } <span class="ruby-comment"># {id =&gt; ...} for DAP</span>
  <span class="ruby-ivar">@src_map</span>   = {} <span class="ruby-comment"># {id =&gt; src}</span>

  <span class="ruby-ivar">@scr_id_map</span> = {} <span class="ruby-comment"># for CDP</span>
  <span class="ruby-ivar">@obj_map</span> = {} <span class="ruby-comment"># { object_id =&gt; ... } for CDP</span>

  <span class="ruby-ivar">@tp_thread_begin</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@tp_thread_end</span> = <span class="ruby-keyword">nil</span>

  <span class="ruby-ivar">@commands</span> = {}
  <span class="ruby-ivar">@unsafe_context</span> = <span class="ruby-keyword">false</span>

  <span class="ruby-ivar">@has_keep_script_lines</span> = <span class="ruby-constant">RubyVM</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-value">:keep_script_lines</span>

  <span class="ruby-ivar">@tp_load_script</span> = <span class="ruby-constant">TracePoint</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:script_compiled</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">tp</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">eval_script</span> = <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">eval_script</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@has_keep_script_lines</span>
    <span class="ruby-constant">ThreadClient</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">on_load</span> <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">instruction_sequence</span>, <span class="ruby-identifier">eval_script</span>
  }
  <span class="ruby-ivar">@tp_load_script</span>.<span class="ruby-identifier">enable</span>

  <span class="ruby-ivar">@thread_stopper</span> = <span class="ruby-identifier">thread_stopper</span>
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">postmortem</span> = <span class="ruby-constant">CONFIG</span>[<span class="ruby-value">:postmortem</span>]

  <span class="ruby-identifier">register_default_command</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Public Instance Methods</h3>
                </header>

                  <div id="method-i-activate" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">activate</span><span
                                class="method-args">(ui = nil, on_fork: false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="activate-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 168</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">activate</span> <span class="ruby-identifier">ui</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-value">on_fork:</span> <span class="ruby-keyword">false</span>
  <span class="ruby-ivar">@ui</span> = <span class="ruby-identifier">ui</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">ui</span>

  <span class="ruby-ivar">@tp_thread_begin</span>&amp;.<span class="ruby-identifier">disable</span>
  <span class="ruby-ivar">@tp_thread_end</span>&amp;.<span class="ruby-identifier">disable</span>
  <span class="ruby-ivar">@tp_thread_begin</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@tp_thread_end</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">activate</span> <span class="ruby-keyword">self</span>, <span class="ruby-value">on_fork:</span> <span class="ruby-identifier">on_fork</span>

  <span class="ruby-identifier">q</span> = <span class="ruby-constant">Queue</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-identifier">first_q</span> = <span class="ruby-constant">Queue</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-ivar">@session_server</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">do</span>
    <span class="ruby-comment"># make sure `@session_server` is assigned</span>
    <span class="ruby-identifier">first_q</span>.<span class="ruby-identifier">pop</span>; <span class="ruby-identifier">first_q</span> = <span class="ruby-keyword">nil</span>

    <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">name</span> = <span class="ruby-string">&#39;DEBUGGER__::SESSION@server&#39;</span>
    <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">abort_on_exception</span> = <span class="ruby-keyword">true</span>

    <span class="ruby-comment"># Thread management</span>
    <span class="ruby-identifier">setup_threads</span>
    <span class="ruby-identifier">thc</span> = <span class="ruby-identifier">get_thread_client</span> <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>
    <span class="ruby-identifier">thc</span>.<span class="ruby-identifier">mark_as_management</span>

    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:reader_thread</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">thc</span> = <span class="ruby-identifier">get_thread_client</span>(<span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">reader_thread</span>)
      <span class="ruby-identifier">thc</span>.<span class="ruby-identifier">mark_as_management</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-ivar">@tp_thread_begin</span> = <span class="ruby-constant">TracePoint</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:thread_begin</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tp</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">get_thread_client</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@tp_thread_begin</span>.<span class="ruby-identifier">enable</span>

    <span class="ruby-ivar">@tp_thread_end</span> = <span class="ruby-constant">TracePoint</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:thread_end</span>) <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">tp</span><span class="ruby-operator">|</span>
      <span class="ruby-ivar">@th_clients</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>)
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@tp_thread_end</span>.<span class="ruby-identifier">enable</span>

    <span class="ruby-comment"># session start</span>
    <span class="ruby-identifier">q</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword">true</span>
    <span class="ruby-identifier">session_server_main</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">first_q</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">:ok</span>

  <span class="ruby-identifier">q</span>.<span class="ruby-identifier">pop</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-active-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">active?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="active-3F-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 150</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">active?</span>
  <span class="ruby-operator">!</span><span class="ruby-ivar">@q_evt</span>.<span class="ruby-identifier">closed?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-add_bp" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_bp</span><span
                                class="method-args">(bp)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="add_bp-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1384</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_bp</span> <span class="ruby-identifier">bp</span>
  <span class="ruby-comment"># don&#39;t repeat commands that add breakpoints</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@bps</span>.<span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">key</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">duplicable?</span>
      <span class="ruby-identifier">bp</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;duplicated breakpoint: #{bp}&quot;</span>
      <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">disable</span>
      <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@bps</span>[<span class="ruby-identifier">bp</span>.<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">bp</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-add_catch_breakpoint" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_catch_breakpoint</span><span
                                class="method-args">(pat, cond: nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="add_catch_breakpoint-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1484</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_catch_breakpoint</span> <span class="ruby-identifier">pat</span>, <span class="ruby-value">cond:</span> <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">bp</span> = <span class="ruby-constant">CatchBreakpoint</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">pat</span>, <span class="ruby-value">cond:</span> <span class="ruby-identifier">cond</span>)
  <span class="ruby-identifier">add_bp</span> <span class="ruby-identifier">bp</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-add_check_breakpoint" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_check_breakpoint</span><span
                                class="method-args">(cond, path, command)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="add_check_breakpoint-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1489</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_check_breakpoint</span> <span class="ruby-identifier">cond</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">command</span>
  <span class="ruby-identifier">bp</span> = <span class="ruby-constant">CheckBreakpoint</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">cond:</span> <span class="ruby-identifier">cond</span>, <span class="ruby-value">path:</span> <span class="ruby-identifier">path</span>, <span class="ruby-value">command:</span> <span class="ruby-identifier">command</span>)
  <span class="ruby-identifier">add_bp</span> <span class="ruby-identifier">bp</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-add_iseq_breakpoint" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_iseq_breakpoint</span><span
                                class="method-args">(iseq, **kw)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="add_iseq_breakpoint-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1531</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_iseq_breakpoint</span> <span class="ruby-identifier">iseq</span>, <span class="ruby-operator">**</span><span class="ruby-identifier">kw</span>
  <span class="ruby-identifier">bp</span> = <span class="ruby-constant">ISeqBreakpoint</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">iseq</span>, [<span class="ruby-value">:line</span>], <span class="ruby-operator">**</span><span class="ruby-identifier">kw</span>)
  <span class="ruby-identifier">add_bp</span> <span class="ruby-identifier">bp</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-add_line_breakpoint" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_line_breakpoint</span><span
                                class="method-args">(file, line, **kw)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="add_line_breakpoint-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1494</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_line_breakpoint</span> <span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span>, <span class="ruby-operator">**</span><span class="ruby-identifier">kw</span>
  <span class="ruby-identifier">file</span> = <span class="ruby-identifier">resolve_path</span>(<span class="ruby-identifier">file</span>)
  <span class="ruby-identifier">bp</span> = <span class="ruby-constant">LineBreakpoint</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span>, <span class="ruby-operator">**</span><span class="ruby-identifier">kw</span>)

  <span class="ruby-identifier">add_bp</span> <span class="ruby-identifier">bp</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ENOENT</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-add_preset_commands" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_preset_commands</span><span
                                class="method-args">(name, cmds, kick: true, continue: true)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="add_preset_commands-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 357</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_preset_commands</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">cmds</span>, <span class="ruby-value">kick:</span> <span class="ruby-keyword">true</span>, <span class="ruby-value">continue:</span> <span class="ruby-keyword">true</span>
  <span class="ruby-identifier">cs</span> = <span class="ruby-identifier">cmds</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">c</span>.<span class="ruby-identifier">each_line</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">line</span> = <span class="ruby-identifier">line</span>.<span class="ruby-identifier">strip</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/\A\s*\#.*/</span>, <span class="ruby-string">&#39;&#39;</span>).<span class="ruby-identifier">strip</span>
      <span class="ruby-identifier">line</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">empty?</span>
    }.<span class="ruby-identifier">compact</span>
  }.<span class="ruby-identifier">flatten</span>.<span class="ruby-identifier">compact</span>

  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@preset_command</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@preset_command</span>.<span class="ruby-identifier">commands</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-ivar">@preset_command</span>.<span class="ruby-identifier">commands</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">cs</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@preset_command</span> = <span class="ruby-constant">PresetCommands</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">cs</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">continue</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-constant">ThreadClient</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">on_init</span> <span class="ruby-identifier">name</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">kick</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-add_tracer" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">add_tracer</span><span
                                class="method-args">(tracer)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>tracers</p>

                              <div class="method-source-code" id="add_tracer-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1538</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">add_tracer</span> <span class="ruby-identifier">tracer</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@tracers</span>[<span class="ruby-identifier">tracer</span>.<span class="ruby-identifier">key</span>]&amp;.<span class="ruby-identifier">enabled?</span>
    <span class="ruby-identifier">tracer</span>.<span class="ruby-identifier">disable</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Duplicated tracer: #{tracer}&quot;</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@tracers</span>[<span class="ruby-identifier">tracer</span>.<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">tracer</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Enable #{tracer}&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-after_fork_parent" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">after_fork_parent</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="after_fork_parent-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1993</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">after_fork_parent</span>
  <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">after_fork_parent</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-ask" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ask</span><span
                                class="method-args">(msg, default = &#39;Y&#39;)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ask-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1326</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ask</span> <span class="ruby-identifier">msg</span>, <span class="ruby-identifier">default</span> = <span class="ruby-string">&#39;Y&#39;</span>
  <span class="ruby-identifier">opts</span> = <span class="ruby-string">&#39;[y/n]&#39;</span>.<span class="ruby-identifier">tr</span>(<span class="ruby-identifier">default</span>.<span class="ruby-identifier">downcase</span>, <span class="ruby-identifier">default</span>)
  <span class="ruby-identifier">input</span> = <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">ask</span>(<span class="ruby-node">&quot;#{msg} #{opts} &quot;</span>)
  <span class="ruby-identifier">input</span> = <span class="ruby-identifier">default</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">input</span>.<span class="ruby-identifier">empty?</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">input</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;y&#39;</span>, <span class="ruby-string">&#39;Y&#39;</span>
    <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-before_fork" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">before_fork</span><span
                                class="method-args">(need_lock = true)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="before_fork-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1987</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">before_fork</span> <span class="ruby-identifier">need_lock</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">need_lock</span>
    <span class="ruby-ivar">@process_group</span>.<span class="ruby-identifier">multi_process!</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-bp_index" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">bp_index</span><span
                                class="method-args">(specific_bp_key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="bp_index-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1361</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">bp_index</span> <span class="ruby-identifier">specific_bp_key</span>
  <span class="ruby-identifier">iterate_bps</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">bp</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">key</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">specific_bp_key</span>
      <span class="ruby-keyword">return</span> [<span class="ruby-identifier">bp</span>, <span class="ruby-identifier">i</span>]
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-cancel_auto_continue" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">cancel_auto_continue</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="cancel_auto_continue-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1274</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">cancel_auto_continue</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@preset_command</span>&amp;.<span class="ruby-identifier">auto_continue</span>
    <span class="ruby-ivar">@preset_command</span>.<span class="ruby-identifier">auto_continue</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-capture_exception_frames" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">capture_exception_frames</span><span
                                class="method-args">(*exclude_path) { || ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="capture_exception_frames-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1873</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">capture_exception_frames</span> <span class="ruby-operator">*</span><span class="ruby-identifier">exclude_path</span>
  <span class="ruby-identifier">postmortem_hook</span> = <span class="ruby-constant">TracePoint</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:raise</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">tp</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">exc</span> = <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">raised_exception</span>
    <span class="ruby-identifier">frames</span> = <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">capture_frames</span>(<span class="ruby-identifier">__dir__</span>)

    <span class="ruby-identifier">exclude_path</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">ex</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">if</span> <span class="ruby-constant">Regexp</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">ex</span>
        <span class="ruby-identifier">frames</span>.<span class="ruby-identifier">delete_if</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">ex</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">path</span>}
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">frames</span>.<span class="ruby-identifier">delete_if</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">path</span>.<span class="ruby-identifier">start_with?</span> <span class="ruby-identifier">ex</span>.<span class="ruby-identifier">to_s</span>}
      <span class="ruby-keyword">end</span>
    }
    <span class="ruby-identifier">exc</span>.<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-value">:@__debugger_postmortem_frames</span>, <span class="ruby-identifier">frames</span>)
  }
  <span class="ruby-identifier">postmortem_hook</span>.<span class="ruby-identifier">enable</span>

  <span class="ruby-keyword">begin</span>
    <span class="ruby-keyword">yield</span>
    <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">instance_variable_defined?</span> <span class="ruby-value">:@__debugger_postmortem_frames</span>
      <span class="ruby-identifier">e</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">raise</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">ensure</span>
    <span class="ruby-identifier">postmortem_hook</span>.<span class="ruby-identifier">disable</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-check_postmortem" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">check_postmortem</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="check_postmortem-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1851</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">check_postmortem</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@postmortem</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">PostmortemError</span>, <span class="ruby-string">&quot;Can not use this command on postmortem mode.&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-check_unsafe" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">check_unsafe</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="check_unsafe-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1857</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">check_unsafe</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@unsafe_context</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-constant">RuntimeError</span>, <span class="ruby-node">&quot;#{@repl_prev_line.dump} is not allowed on unsafe context.&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-clean_bps" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">clean_bps</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="clean_bps-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1378</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clean_bps</span>
  <span class="ruby-ivar">@bps</span>.<span class="ruby-identifier">delete_if</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">_k</span>, <span class="ruby-identifier">bp</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">deleted?</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-clear_all_breakpoints" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">clear_all_breakpoints</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="clear_all_breakpoints-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1527</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clear_all_breakpoints</span>
  <span class="ruby-identifier">clear_breakpoints</span>{<span class="ruby-keyword">true</span>}
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-clear_breakpoints" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">clear_breakpoints</span><span
                                class="method-args">(&amp;condition)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="clear_breakpoints-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1503</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clear_breakpoints</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">condition</span>)
  <span class="ruby-ivar">@bps</span>.<span class="ruby-identifier">delete_if</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">bp</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">condition</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">k</span>, <span class="ruby-identifier">bp</span>)
      <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">delete</span>
      <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-clear_catch_breakpoints" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">clear_catch_breakpoints</span><span
                                class="method-args">(*exception_names)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="clear_catch_breakpoints-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1521</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clear_catch_breakpoints</span> <span class="ruby-operator">*</span><span class="ruby-identifier">exception_names</span>
  <span class="ruby-identifier">clear_breakpoints</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">bp</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">CatchBreakpoint</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">exception_names</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">k</span>[<span class="ruby-value">1</span>])
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-clear_line_breakpoints" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">clear_line_breakpoints</span><span
                                class="method-args">(path)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="clear_line_breakpoints-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1512</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">clear_line_breakpoints</span> <span class="ruby-identifier">path</span>
  <span class="ruby-identifier">path</span> = <span class="ruby-identifier">resolve_path</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-identifier">clear_breakpoints</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">bp</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">LineBreakpoint</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">path_is?</span>(<span class="ruby-identifier">path</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ENOENT</span>
  <span class="ruby-comment"># just ignore</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-config_command" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">config_command</span><span
                                class="method-args">(arg)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="config_command-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1240</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">config_command</span> <span class="ruby-identifier">arg</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">arg</span>
  <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>
    <span class="ruby-constant">CONFIG_SET</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">_</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">config_show</span> <span class="ruby-identifier">k</span>
    <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\Aunset\s+(.+)\z/</span>
    <span class="ruby-keyword">if</span> <span class="ruby-constant">CONFIG_SET</span>[<span class="ruby-identifier">key</span> = <span class="ruby-node">$1</span>.<span class="ruby-identifier">to_sym</span>]
      <span class="ruby-constant">CONFIG</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">config_show</span> <span class="ruby-identifier">key</span>

  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A(\w+)\s*=\s*(.+)\z/</span>
    <span class="ruby-identifier">config_set</span> <span class="ruby-node">$1</span>, <span class="ruby-node">$2</span>

  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A\s*set\s+(\w+)\s+(.+)\z/</span>
    <span class="ruby-identifier">config_set</span> <span class="ruby-node">$1</span>, <span class="ruby-node">$2</span>

  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A(\w+)\s*&lt;&lt;\s*(.+)\z/</span>
    <span class="ruby-identifier">config_set</span> <span class="ruby-node">$1</span>, <span class="ruby-node">$2</span>, <span class="ruby-value">append:</span> <span class="ruby-keyword">true</span>

  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A\s*append\s+(\w+)\s+(.+)\z/</span>
    <span class="ruby-identifier">config_set</span> <span class="ruby-node">$1</span>, <span class="ruby-node">$2</span>, <span class="ruby-value">append:</span> <span class="ruby-keyword">true</span>

  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A(\w+)\z/</span>
    <span class="ruby-identifier">config_show</span> <span class="ruby-node">$1</span>

  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Can not parse parameters: #{arg}&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-config_set" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">config_set</span><span
                                class="method-args">(key, val, append: false)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="config_set-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1224</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">config_set</span> <span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>, <span class="ruby-value">append:</span> <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">if</span> <span class="ruby-constant">CONFIG_SET</span>[<span class="ruby-identifier">key</span> = <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_sym</span>]
    <span class="ruby-keyword">begin</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">append</span>
        <span class="ruby-constant">CONFIG</span>.<span class="ruby-identifier">append_config</span>(<span class="ruby-identifier">key</span>, <span class="ruby-identifier">val</span>)
      <span class="ruby-keyword">else</span>
        <span class="ruby-constant">CONFIG</span>[<span class="ruby-identifier">key</span>] = <span class="ruby-identifier">val</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">rescue</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">config_show</span> <span class="ruby-identifier">key</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-config_show" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">config_show</span><span
                                class="method-args">(key)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="config_show-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1200</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">config_show</span> <span class="ruby-identifier">key</span>
  <span class="ruby-identifier">key</span> = <span class="ruby-identifier">key</span>.<span class="ruby-identifier">to_sym</span>
  <span class="ruby-identifier">config_detail</span> = <span class="ruby-constant">CONFIG_SET</span>[<span class="ruby-identifier">key</span>]

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">config_detail</span>
    <span class="ruby-identifier">v</span> = <span class="ruby-constant">CONFIG</span>[<span class="ruby-identifier">key</span>]
    <span class="ruby-identifier">kv</span> = <span class="ruby-node">&quot;#{key} = #{v.inspect}&quot;</span>
    <span class="ruby-identifier">desc</span> = <span class="ruby-identifier">config_detail</span>[<span class="ruby-value">1</span>]

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">config_default</span> = <span class="ruby-identifier">config_detail</span>[<span class="ruby-value">3</span>]
      <span class="ruby-identifier">desc</span> <span class="ruby-operator">+=</span> <span class="ruby-node">&quot; (default: #{config_default})&quot;</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">line</span> = <span class="ruby-string">&quot;%-34s \# %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">kv</span>, <span class="ruby-identifier">desc</span>]
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-constant">SESSION</span>.<span class="ruby-identifier">width</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;\# #{desc}\n#{kv}&quot;</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">line</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Unknown configuration: #{key}. &#39;config&#39; shows all configurations.&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-deactivate" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">deactivate</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="deactivate-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 214</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">deactivate</span>
  <span class="ruby-identifier">get_thread_client</span>.<span class="ruby-identifier">deactivate</span>
  <span class="ruby-ivar">@thread_stopper</span>.<span class="ruby-identifier">disable</span>
  <span class="ruby-ivar">@tp_load_script</span>.<span class="ruby-identifier">disable</span>
  <span class="ruby-ivar">@tp_thread_begin</span>.<span class="ruby-identifier">disable</span>
  <span class="ruby-ivar">@tp_thread_end</span>.<span class="ruby-identifier">disable</span>
  <span class="ruby-ivar">@bps</span>.<span class="ruby-identifier">each_value</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">bp</span><span class="ruby-operator">|</span> <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">disable</span>}
  <span class="ruby-ivar">@th_clients</span>.<span class="ruby-identifier">each_value</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">thc</span><span class="ruby-operator">|</span> <span class="ruby-identifier">thc</span>.<span class="ruby-identifier">close</span>}
  <span class="ruby-ivar">@tracers</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">disable</span>}
  <span class="ruby-ivar">@q_evt</span>.<span class="ruby-identifier">close</span>
  <span class="ruby-ivar">@ui</span>&amp;.<span class="ruby-identifier">deactivate</span>
  <span class="ruby-ivar">@ui</span> = <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-delete_bp" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">delete_bp</span><span
                                class="method-args">(arg = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="delete_bp-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1399</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">delete_bp</span> <span class="ruby-identifier">arg</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">arg</span>
  <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>
    <span class="ruby-ivar">@bps</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">bp</span><span class="ruby-operator">|</span> <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">delete</span>}
    <span class="ruby-ivar">@bps</span>.<span class="ruby-identifier">clear</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">del_bp</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-identifier">iterate_bps</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">bp</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-identifier">del_bp</span> = <span class="ruby-identifier">bp</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">i</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">arg</span>}
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">del_bp</span>
      <span class="ruby-identifier">del_bp</span>.<span class="ruby-identifier">delete</span>
      <span class="ruby-ivar">@bps</span>.<span class="ruby-identifier">delete</span> <span class="ruby-identifier">del_bp</span>.<span class="ruby-identifier">key</span>
      <span class="ruby-keyword">return</span> [<span class="ruby-identifier">arg</span>, <span class="ruby-identifier">del_bp</span>]
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-enter_postmortem_session" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">enter_postmortem_session</span><span
                                class="method-args">(exc)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="enter_postmortem_session-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1863</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">enter_postmortem_session</span> <span class="ruby-identifier">exc</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">exc</span>.<span class="ruby-identifier">instance_variable_defined?</span> <span class="ruby-value">:@__debugger_postmortem_frames</span>

  <span class="ruby-identifier">frames</span> = <span class="ruby-identifier">exc</span>.<span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-value">:@__debugger_postmortem_frames</span>)
  <span class="ruby-ivar">@postmortem</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-constant">ThreadClient</span>.<span class="ruby-identifier">current</span>.<span class="ruby-identifier">suspend</span> <span class="ruby-value">:postmortem</span>, <span class="ruby-value">postmortem_frames:</span> <span class="ruby-identifier">frames</span>, <span class="ruby-value">postmortem_exc:</span> <span class="ruby-identifier">exc</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-ivar">@postmortem</span> = <span class="ruby-keyword">false</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-extend_feature" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">extend_feature</span><span
                                class="method-args">(session: nil, thread_client: nil, ui: nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>experimental API</p>

                              <div class="method-source-code" id="extend_feature-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1998</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">extend_feature</span> <span class="ruby-value">session:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">thread_client:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">ui:</span> <span class="ruby-keyword">nil</span>
  <span class="ruby-constant">Session</span>.<span class="ruby-identifier">include</span> <span class="ruby-identifier">session</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">session</span>
  <span class="ruby-constant">ThreadClient</span>.<span class="ruby-identifier">include</span> <span class="ruby-identifier">thread_client</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">thread_client</span>
  <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">extend</span> <span class="ruby-identifier">ui</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">ui</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-fail_response" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">fail_response</span><span
                                class="method-args">(req, **result)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="fail_response-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_cdp.rb, line 723</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">fail_response</span> <span class="ruby-identifier">req</span>, <span class="ruby-operator">**</span><span class="ruby-identifier">result</span>
  <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">respond_fail</span> <span class="ruby-identifier">req</span>, <span class="ruby-operator">**</span><span class="ruby-identifier">result</span>
  <span class="ruby-keyword">return</span> <span class="ruby-value">:retry</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-find_waiting_tc" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">find_waiting_tc</span><span
                                class="method-args">(id)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="find_waiting_tc-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_dap.rb, line 557</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">find_waiting_tc</span> <span class="ruby-identifier">id</span>
  <span class="ruby-ivar">@th_clients</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">th</span>, <span class="ruby-identifier">tc</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">return</span> <span class="ruby-identifier">tc</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">tc</span>.<span class="ruby-identifier">id</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">id</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">tc</span>.<span class="ruby-identifier">waiting?</span>
  }
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-get_thread_client" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">get_thread_client</span><span
                                class="method-args">(th = Thread.current)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>can be called by other threads</p>

                              <div class="method-source-code" id="get_thread_client-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1638</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_thread_client</span> <span class="ruby-identifier">th</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@th_clients</span>.<span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">th</span>
    <span class="ruby-ivar">@th_clients</span>[<span class="ruby-identifier">th</span>]
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">if</span> <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@session_server</span>
      <span class="ruby-identifier">create_thread_client</span> <span class="ruby-identifier">th</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">ask_thread_client</span> <span class="ruby-identifier">th</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-get_type" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">get_type</span><span
                                class="method-args">(obj)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>FIXME: unify this method with <a href="ThreadClient.html#method-i-propertyDescriptor"><code>ThreadClient#propertyDescriptor</code></a>.</p>

                              <div class="method-source-code" id="get_type-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_cdp.rb, line 702</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">get_type</span> <span class="ruby-identifier">obj</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">obj</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Array</span>
    [<span class="ruby-string">&#39;object&#39;</span>, <span class="ruby-string">&#39;array&#39;</span>]
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Hash</span>
    [<span class="ruby-string">&#39;object&#39;</span>, <span class="ruby-string">&#39;map&#39;</span>]
  <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span>
    [<span class="ruby-string">&#39;string&#39;</span>]
  <span class="ruby-keyword">when</span> <span class="ruby-constant">TrueClass</span>, <span class="ruby-constant">FalseClass</span>
    [<span class="ruby-string">&#39;boolean&#39;</span>]
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Symbol</span>
    [<span class="ruby-string">&#39;symbol&#39;</span>]
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Integer</span>, <span class="ruby-constant">Float</span>
    [<span class="ruby-string">&#39;number&#39;</span>]
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Exception</span>
    [<span class="ruby-string">&#39;object&#39;</span>, <span class="ruby-string">&#39;error&#39;</span>]
  <span class="ruby-keyword">else</span>
    [<span class="ruby-string">&#39;object&#39;</span>]
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-in_subsession-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">in_subsession?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="in_subsession-3F-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1727</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">in_subsession?</span>
  <span class="ruby-operator">!</span><span class="ruby-ivar">@subsession_stack</span>.<span class="ruby-identifier">empty?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-inspect" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">inspect</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="inspect-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 382</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">inspect</span>
  <span class="ruby-string">&quot;DEBUGGER__::SESSION&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-intercept_trap_sigint" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">intercept_trap_sigint</span><span
                                class="method-args">(flag) { || ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="intercept_trap_sigint-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1962</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">intercept_trap_sigint</span> <span class="ruby-identifier">flag</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>
  <span class="ruby-identifier">prev</span> = <span class="ruby-ivar">@intercept_trap_sigint</span>
  <span class="ruby-ivar">@intercept_trap_sigint</span> = <span class="ruby-identifier">flag</span>
  <span class="ruby-keyword">yield</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-ivar">@intercept_trap_sigint</span> = <span class="ruby-identifier">prev</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-intercept_trap_sigint-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">intercept_trap_sigint?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="intercept_trap_sigint-3F-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1958</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">intercept_trap_sigint?</span>
  <span class="ruby-ivar">@intercept_trap_sigint</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-intercept_trap_sigint_end" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">intercept_trap_sigint_end</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="intercept_trap_sigint_end-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1975</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">intercept_trap_sigint_end</span>
  <span class="ruby-ivar">@intercept_trap_sigint</span> = <span class="ruby-keyword">false</span>
  <span class="ruby-identifier">prev</span>, <span class="ruby-ivar">@intercepted_sigint_cmd</span> = <span class="ruby-ivar">@intercepted_sigint_cmd</span>, <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">prev</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-intercept_trap_sigint_start" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">intercept_trap_sigint_start</span><span
                                class="method-args">(prev)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="intercept_trap_sigint_start-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1970</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">intercept_trap_sigint_start</span> <span class="ruby-identifier">prev</span>
  <span class="ruby-ivar">@intercept_trap_sigint</span> = <span class="ruby-keyword">true</span>
  <span class="ruby-ivar">@intercepted_sigint_cmd</span> = <span class="ruby-identifier">prev</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-iterate_bps" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">iterate_bps</span><span
                                class="method-args">() { |key, bp, i| ... }</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>breakpoint management</p>

                              <div class="method-source-code" id="iterate_bps-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1340</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">iterate_bps</span>
  <span class="ruby-identifier">deleted_bps</span> = []
  <span class="ruby-identifier">i</span> = <span class="ruby-value">0</span>
  <span class="ruby-ivar">@bps</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">bp</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">bp</span>.<span class="ruby-identifier">deleted?</span>
      <span class="ruby-keyword">yield</span> <span class="ruby-identifier">key</span>, <span class="ruby-identifier">bp</span>, <span class="ruby-identifier">i</span>
      <span class="ruby-identifier">i</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">deleted_bps</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">bp</span>
    <span class="ruby-keyword">end</span>
  }
<span class="ruby-keyword">ensure</span>
  <span class="ruby-identifier">deleted_bps</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">bp</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@bps</span>.<span class="ruby-identifier">delete</span> <span class="ruby-identifier">bp</span>}
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-managed_thread_clients" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">managed_thread_clients</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="managed_thread_clients-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1582</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">managed_thread_clients</span>
  <span class="ruby-identifier">thcs</span>, <span class="ruby-identifier">_unmanaged_ths</span> = <span class="ruby-identifier">update_thread_list</span>
  <span class="ruby-identifier">thcs</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-method_added" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">method_added</span><span
                                class="method-args">(tp)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="method_added-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1780</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">method_added</span> <span class="ruby-identifier">tp</span>
  <span class="ruby-identifier">b</span> = <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">binding</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">var_name</span> = <span class="ruby-identifier">b</span>.<span class="ruby-identifier">local_variables</span>.<span class="ruby-identifier">first</span>
    <span class="ruby-identifier">mid</span> = <span class="ruby-identifier">b</span>.<span class="ruby-identifier">local_variable_get</span>(<span class="ruby-identifier">var_name</span>)
    <span class="ruby-identifier">resolved</span> = <span class="ruby-keyword">true</span>

    <span class="ruby-ivar">@bps</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">bp</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">bp</span>
      <span class="ruby-keyword">when</span> <span class="ruby-constant">MethodBreakpoint</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">method</span>.<span class="ruby-identifier">nil?</span>
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">sig_method_name</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">mid</span>.<span class="ruby-identifier">to_s</span>
            <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">try_enable</span>(<span class="ruby-value">added:</span> <span class="ruby-keyword">true</span>)
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">end</span>

        <span class="ruby-identifier">resolved</span> = <span class="ruby-keyword">false</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">bp</span>.<span class="ruby-identifier">enabled?</span>
      <span class="ruby-keyword">end</span>
    }

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">resolved</span>
      <span class="ruby-constant">Session</span>.<span class="ruby-identifier">deactivate_method_added_trackers</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">case</span> <span class="ruby-identifier">mid</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:method_added</span>, <span class="ruby-value">:singleton_method_added</span>
      <span class="ruby-constant">Session</span>.<span class="ruby-identifier">create_method_added_tracker</span>(<span class="ruby-identifier">tp</span>.<span class="ruby-identifier">self</span>, <span class="ruby-identifier">mid</span>)
      <span class="ruby-constant">Session</span>.<span class="ruby-identifier">activate_method_added_trackers</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">resolved</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-on_load" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">on_load</span><span
                                class="method-args">(iseq, src)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>event</p>

                              <div class="method-source-code" id="on_load-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1733</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">on_load</span> <span class="ruby-identifier">iseq</span>, <span class="ruby-identifier">src</span>
  <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">info</span> <span class="ruby-node">&quot;Load #{iseq.absolute_path || iseq.path}&quot;</span>

  <span class="ruby-identifier">file_path</span>, <span class="ruby-identifier">reloaded</span> = <span class="ruby-ivar">@sr</span>.<span class="ruby-identifier">add</span>(<span class="ruby-identifier">iseq</span>, <span class="ruby-identifier">src</span>)
  <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">event</span> <span class="ruby-value">:load</span>, <span class="ruby-identifier">file_path</span>, <span class="ruby-identifier">reloaded</span>

  <span class="ruby-comment"># check breakpoints</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">file_path</span>
    <span class="ruby-ivar">@bps</span>.<span class="ruby-identifier">find_all</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">_key</span>, <span class="ruby-identifier">bp</span><span class="ruby-operator">|</span>
      <span class="ruby-constant">LineBreakpoint</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">bp</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">path_is?</span>(<span class="ruby-identifier">file_path</span>)
    <span class="ruby-keyword">end</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">_key</span>, <span class="ruby-identifier">bp</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">bp</span>.<span class="ruby-identifier">iseq</span>
        <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">try_activate</span> <span class="ruby-identifier">iseq</span>
      <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">reloaded</span>
        <span class="ruby-ivar">@bps</span>.<span class="ruby-identifier">delete</span> <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">key</span> <span class="ruby-comment"># to allow duplicate</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">nbp</span> = <span class="ruby-constant">LineBreakpoint</span>.<span class="ruby-identifier">copy</span>(<span class="ruby-identifier">bp</span>, <span class="ruby-identifier">iseq</span>)
          <span class="ruby-identifier">add_bp</span> <span class="ruby-identifier">nbp</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span> <span class="ruby-comment"># !file_path =&gt; file_path is not existing</span>
    <span class="ruby-ivar">@bps</span>.<span class="ruby-identifier">find_all</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">_key</span>, <span class="ruby-identifier">bp</span><span class="ruby-operator">|</span>
      <span class="ruby-constant">LineBreakpoint</span> <span class="ruby-operator">===</span> <span class="ruby-identifier">bp</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">bp</span>.<span class="ruby-identifier">iseq</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">compare_path</span>(<span class="ruby-identifier">bp</span>.<span class="ruby-identifier">path</span>, (<span class="ruby-identifier">iseq</span>.<span class="ruby-identifier">absolute_path</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">iseq</span>.<span class="ruby-identifier">path</span>))
    <span class="ruby-keyword">end</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">_key</span>, <span class="ruby-identifier">bp</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">try_activate</span> <span class="ruby-identifier">iseq</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-on_thread_begin" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">on_thread_begin</span><span
                                class="method-args">(th)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="on_thread_begin-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1613</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">on_thread_begin</span> <span class="ruby-identifier">th</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@th_clients</span>.<span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">th</span>
    <span class="ruby-comment"># TODO: NG?</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">create_thread_client</span> <span class="ruby-identifier">th</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-pop_event" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">pop_event</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="pop_event-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 243</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">pop_event</span>
  <span class="ruby-ivar">@q_evt</span>.<span class="ruby-identifier">pop</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-postmortem-3D" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">postmortem=</span><span
                                class="method-args">(is_enable)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="postmortem-3D-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1903</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">postmortem=</span>(<span class="ruby-identifier">is_enable</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">is_enable</span>
    <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@postmortem_hook</span>
      <span class="ruby-ivar">@postmortem_hook</span> = <span class="ruby-constant">TracePoint</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:raise</span>){<span class="ruby-operator">|</span><span class="ruby-identifier">tp</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">exc</span> = <span class="ruby-identifier">tp</span>.<span class="ruby-identifier">raised_exception</span>
        <span class="ruby-identifier">frames</span> = <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">capture_frames</span>(<span class="ruby-identifier">__dir__</span>)
        <span class="ruby-identifier">exc</span>.<span class="ruby-identifier">instance_variable_set</span>(<span class="ruby-value">:@__debugger_postmortem_frames</span>, <span class="ruby-identifier">frames</span>)
      }
      <span class="ruby-identifier">at_exit</span>{
        <span class="ruby-ivar">@postmortem_hook</span>.<span class="ruby-identifier">disable</span>
        <span class="ruby-keyword">if</span> <span class="ruby-constant">CONFIG</span>[<span class="ruby-value">:postmortem</span>] <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-identifier">exc</span> = <span class="ruby-identifier">$!</span>) <span class="ruby-operator">!=</span> <span class="ruby-keyword">nil</span>
          <span class="ruby-identifier">exc</span> = <span class="ruby-identifier">exc</span>.<span class="ruby-identifier">cause</span> <span class="ruby-keyword">while</span> <span class="ruby-identifier">exc</span>.<span class="ruby-identifier">cause</span>

          <span class="ruby-keyword">begin</span>
            <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Enter postmortem mode with #{exc.inspect}&quot;</span>
            <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">exc</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-string">&#39;  &#39;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">e</span>}
            <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;\n&quot;</span>

            <span class="ruby-identifier">enter_postmortem_session</span> <span class="ruby-identifier">exc</span>
          <span class="ruby-keyword">rescue</span> <span class="ruby-constant">SystemExit</span>
            <span class="ruby-identifier">exit!</span>
          <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
            <span class="ruby-ivar">@ui</span> = <span class="ruby-constant">STDERR</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@ui</span>
            <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Error while postmortem console: #{e.inspect}&quot;</span>
          <span class="ruby-keyword">end</span>
        <span class="ruby-keyword">end</span>
      }
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@postmortem_hook</span>.<span class="ruby-identifier">enabled?</span>
      <span class="ruby-ivar">@postmortem_hook</span>.<span class="ruby-identifier">enable</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@postmortem_hook</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@postmortem_hook</span>.<span class="ruby-identifier">enabled?</span>
      <span class="ruby-ivar">@postmortem_hook</span>.<span class="ruby-identifier">disable</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-process_command" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">process_command</span><span
                                class="method-args">(line)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="process_command-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1126</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">process_command</span> <span class="ruby-identifier">line</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@repl_prev_line</span>
      <span class="ruby-identifier">line</span> = <span class="ruby-ivar">@repl_prev_line</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">return</span> <span class="ruby-value">:retry</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@repl_prev_line</span> = <span class="ruby-identifier">line</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-regexp">/([^\s]+)(?:\s+(.+))?/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">line</span>
  <span class="ruby-identifier">cmd_name</span>, <span class="ruby-identifier">cmd_arg</span> = <span class="ruby-node">$1</span>, <span class="ruby-node">$2</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">cmd</span> = <span class="ruby-ivar">@commands</span>[<span class="ruby-identifier">cmd_name</span>]
    <span class="ruby-identifier">check_postmortem</span>      <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">cmd</span>.<span class="ruby-identifier">postmortem</span>
    <span class="ruby-identifier">check_unsafe</span>          <span class="ruby-keyword">if</span> <span class="ruby-identifier">cmd</span>.<span class="ruby-identifier">unsafe</span>
    <span class="ruby-identifier">cancel_auto_continue</span>  <span class="ruby-keyword">if</span> <span class="ruby-identifier">cmd</span>.<span class="ruby-identifier">cancel_auto_continue</span>
    <span class="ruby-ivar">@repl_prev_line</span> = <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">cmd</span>.<span class="ruby-identifier">repeat</span>

    <span class="ruby-identifier">cmd</span>.<span class="ruby-identifier">block</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">cmd_arg</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@repl_prev_line</span> = <span class="ruby-keyword">nil</span>
    <span class="ruby-identifier">check_unsafe</span>

    <span class="ruby-identifier">request_eval</span> <span class="ruby-value">:pp</span>, <span class="ruby-identifier">line</span>
  <span class="ruby-keyword">end</span>

<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Interrupt</span>
  <span class="ruby-keyword">return</span> <span class="ruby-value">:retry</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">SystemExit</span>
  <span class="ruby-identifier">raise</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">PostmortemError</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>
  <span class="ruby-keyword">return</span> <span class="ruby-value">:retry</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;[REPL ERROR] #{e.inspect}&quot;</span>
  <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-string">&#39;  &#39;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">e</span>}
  <span class="ruby-keyword">return</span> <span class="ruby-value">:retry</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-process_event" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">process_event</span><span
                                class="method-args">(evt)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="process_event-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 259</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">process_event</span> <span class="ruby-identifier">evt</span>
  <span class="ruby-comment"># variable `@internal_info` is only used for test</span>
  <span class="ruby-identifier">tc</span>, <span class="ruby-identifier">output</span>, <span class="ruby-identifier">ev</span>, <span class="ruby-ivar">@internal_info</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">ev_args</span> = <span class="ruby-identifier">evt</span>

  <span class="ruby-identifier">output</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">str</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">str</span>} <span class="ruby-keyword">if</span> <span class="ruby-identifier">ev</span> <span class="ruby-operator">!=</span> <span class="ruby-value">:suspend</span>

  <span class="ruby-comment"># special event, tc is nil</span>
  <span class="ruby-comment"># and we don&#39;t want to set @tc to the newly created thread&#39;s ThreadClient</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">ev</span> <span class="ruby-operator">==</span> <span class="ruby-value">:thread_begin</span>
    <span class="ruby-identifier">th</span> = <span class="ruby-identifier">ev_args</span>.<span class="ruby-identifier">shift</span>
    <span class="ruby-identifier">q</span> = <span class="ruby-identifier">ev_args</span>.<span class="ruby-identifier">shift</span>
    <span class="ruby-identifier">on_thread_begin</span> <span class="ruby-identifier">th</span>
    <span class="ruby-identifier">q</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword">true</span>

    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@tc</span> = <span class="ruby-identifier">tc</span>

  <span class="ruby-keyword">case</span> <span class="ruby-identifier">ev</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:init</span>
    <span class="ruby-identifier">enter_subsession</span>
    <span class="ruby-identifier">wait_command_loop</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:load</span>
    <span class="ruby-identifier">iseq</span>, <span class="ruby-identifier">src</span> = <span class="ruby-identifier">ev_args</span>
    <span class="ruby-identifier">on_load</span> <span class="ruby-identifier">iseq</span>, <span class="ruby-identifier">src</span>
    <span class="ruby-identifier">request_tc</span> <span class="ruby-value">:continue</span>

  <span class="ruby-keyword">when</span> <span class="ruby-value">:trace</span>
    <span class="ruby-identifier">trace_id</span>, <span class="ruby-identifier">msg</span> = <span class="ruby-identifier">ev_args</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@tracers</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">find</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">object_id</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">trace_id</span>}
      <span class="ruby-identifier">t</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">msg</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">request_tc</span> <span class="ruby-value">:continue</span>

  <span class="ruby-keyword">when</span> <span class="ruby-value">:suspend</span>
    <span class="ruby-identifier">enter_subsession</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">ev_args</span>.<span class="ruby-identifier">first</span> <span class="ruby-operator">!=</span> <span class="ruby-value">:replay</span>
    <span class="ruby-identifier">output</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">str</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">str</span>} <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">ignore_output_on_suspend?</span>

    <span class="ruby-keyword">case</span> <span class="ruby-identifier">ev_args</span>.<span class="ruby-identifier">first</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:breakpoint</span>
      <span class="ruby-identifier">bp</span>, <span class="ruby-identifier">i</span> = <span class="ruby-identifier">bp_index</span> <span class="ruby-identifier">ev_args</span>[<span class="ruby-value">1</span>]
      <span class="ruby-identifier">clean_bps</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">bp</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">event</span> <span class="ruby-value">:suspend_bp</span>, <span class="ruby-identifier">i</span>, <span class="ruby-identifier">bp</span>, <span class="ruby-ivar">@tc</span>.<span class="ruby-identifier">id</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:trap</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">event</span> <span class="ruby-value">:suspend_trap</span>, <span class="ruby-identifier">sig</span> = <span class="ruby-identifier">ev_args</span>[<span class="ruby-value">1</span>], <span class="ruby-ivar">@tc</span>.<span class="ruby-identifier">id</span>

      <span class="ruby-keyword">if</span> <span class="ruby-identifier">sig</span> <span class="ruby-operator">==</span> <span class="ruby-value">:SIGINT</span> <span class="ruby-operator">&amp;&amp;</span> (<span class="ruby-ivar">@intercepted_sigint_cmd</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Proc</span>) <span class="ruby-operator">||</span> <span class="ruby-ivar">@intercepted_sigint_cmd</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">String</span>))
        <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;#{@intercepted_sigint_cmd.inspect} is registered as SIGINT handler.&quot;</span>
        <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;`sigint` command execute it.&quot;</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">event</span> <span class="ruby-value">:suspended</span>, <span class="ruby-ivar">@tc</span>.<span class="ruby-identifier">id</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@displays</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-identifier">wait_command_loop</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:eval</span>, <span class="ruby-value">:display</span>, <span class="ruby-ivar">@displays</span>]
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:result</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-string">&quot;[BUG] not in subsession&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@subsession_stack</span>.<span class="ruby-identifier">empty?</span>

    <span class="ruby-keyword">case</span> <span class="ruby-identifier">ev_args</span>.<span class="ruby-identifier">first</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:try_display</span>
      <span class="ruby-identifier">failed_results</span> = <span class="ruby-identifier">ev_args</span>[<span class="ruby-value">1</span>]
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">failed_results</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
        <span class="ruby-identifier">i</span>, <span class="ruby-identifier">_msg</span> = <span class="ruby-identifier">failed_results</span>.<span class="ruby-identifier">last</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">i</span><span class="ruby-value">+1</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@displays</span>.<span class="ruby-identifier">size</span>
          <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;canceled: #{@displays.pop}&quot;</span>
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">when</span> <span class="ruby-value">:method_breakpoint</span>, <span class="ruby-value">:watch_breakpoint</span>
      <span class="ruby-identifier">bp</span> = <span class="ruby-identifier">ev_args</span>[<span class="ruby-value">1</span>]
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">bp</span>
        <span class="ruby-identifier">add_bp</span>(<span class="ruby-identifier">bp</span>)
        <span class="ruby-identifier">show_bps</span> <span class="ruby-identifier">bp</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-comment"># can&#39;t make a bp</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:trace_pass</span>
      <span class="ruby-identifier">obj_id</span> = <span class="ruby-identifier">ev_args</span>[<span class="ruby-value">1</span>]
      <span class="ruby-identifier">obj_inspect</span> = <span class="ruby-identifier">ev_args</span>[<span class="ruby-value">2</span>]
      <span class="ruby-identifier">opt</span> = <span class="ruby-identifier">ev_args</span>[<span class="ruby-value">3</span>]
      <span class="ruby-identifier">add_tracer</span> <span class="ruby-constant">ObjectTracer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@ui</span>, <span class="ruby-identifier">obj_id</span>, <span class="ruby-identifier">obj_inspect</span>, <span class="ruby-operator">**</span><span class="ruby-identifier">opt</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">stop_all_threads</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">wait_command_loop</span>

  <span class="ruby-keyword">when</span> <span class="ruby-value">:protocol_result</span>
    <span class="ruby-identifier">process_protocol_result</span> <span class="ruby-identifier">ev_args</span>
    <span class="ruby-identifier">wait_command_loop</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-process_info" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">process_info</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="process_info-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1981</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">process_info</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@process_group</span>.<span class="ruby-identifier">multi?</span>
    <span class="ruby-node">&quot;#{$0}\##{Process.pid}&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-process_protocol_request" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">process_protocol_request</span><span
                                class="method-args">(req)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="process_protocol_request-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_cdp.rb, line 731</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">process_protocol_request</span> <span class="ruby-identifier">req</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">req</span>[<span class="ruby-string">&#39;method&#39;</span>]
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;Debugger.stepOver&#39;</span>, <span class="ruby-string">&#39;Debugger.stepInto&#39;</span>, <span class="ruby-string">&#39;Debugger.stepOut&#39;</span>, <span class="ruby-string">&#39;Debugger.resume&#39;</span>, <span class="ruby-string">&#39;Debugger.enable&#39;</span>
    <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:cdp</span>, <span class="ruby-value">:backtrace</span>, <span class="ruby-identifier">req</span>]
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;Debugger.evaluateOnCallFrame&#39;</span>
    <span class="ruby-identifier">frame_id</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-string">&#39;params&#39;</span>, <span class="ruby-string">&#39;callFrameId&#39;</span>)
    <span class="ruby-identifier">group</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-string">&#39;params&#39;</span>, <span class="ruby-string">&#39;objectGroup&#39;</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">fid</span> = <span class="ruby-ivar">@frame_map</span>[<span class="ruby-identifier">frame_id</span>]
      <span class="ruby-identifier">expr</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-string">&#39;params&#39;</span>, <span class="ruby-string">&#39;expression&#39;</span>)
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:cdp</span>, <span class="ruby-value">:evaluate</span>, <span class="ruby-identifier">req</span>, <span class="ruby-identifier">fid</span>, <span class="ruby-identifier">expr</span>, <span class="ruby-identifier">group</span>]
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">fail_response</span> <span class="ruby-identifier">req</span>,
                    <span class="ruby-value">code:</span> <span class="ruby-constant">INVALID_PARAMS</span>,
                    <span class="ruby-value">message:</span> <span class="ruby-string">&quot;&#39;callFrameId&#39; is an invalid&quot;</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;Runtime.getProperties&#39;</span>, <span class="ruby-string">&#39;Runtime.getExceptionDetails&#39;</span>
    <span class="ruby-identifier">oid</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-string">&#39;params&#39;</span>, <span class="ruby-string">&#39;objectId&#39;</span>) <span class="ruby-operator">||</span> <span class="ruby-identifier">req</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-string">&#39;params&#39;</span>, <span class="ruby-string">&#39;errorObjectId&#39;</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">ref</span> = <span class="ruby-ivar">@obj_map</span>[<span class="ruby-identifier">oid</span>]
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">ref</span>[<span class="ruby-value">0</span>]
      <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;local&#39;</span>
        <span class="ruby-identifier">frame_id</span> = <span class="ruby-identifier">ref</span>[<span class="ruby-value">1</span>]
        <span class="ruby-identifier">fid</span> = <span class="ruby-ivar">@frame_map</span>[<span class="ruby-identifier">frame_id</span>]
        <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:cdp</span>, <span class="ruby-value">:scope</span>, <span class="ruby-identifier">req</span>, <span class="ruby-identifier">fid</span>]
      <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;global&#39;</span>
        <span class="ruby-identifier">vars</span> = <span class="ruby-identifier">safe_global_variables</span>.<span class="ruby-identifier">sort</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
          <span class="ruby-keyword">begin</span>
            <span class="ruby-identifier">gv</span> = <span class="ruby-identifier">eval</span>(<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>)
          <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ENOENT</span>
            <span class="ruby-identifier">gv</span> = <span class="ruby-keyword">nil</span>
          <span class="ruby-keyword">end</span>
          <span class="ruby-identifier">prop</span> = {
            <span class="ruby-value">name:</span> <span class="ruby-identifier">name</span>,
            <span class="ruby-value">value:</span> {
              <span class="ruby-value">description:</span> <span class="ruby-identifier">gv</span>.<span class="ruby-identifier">inspect</span>
            },
            <span class="ruby-value">configurable:</span> <span class="ruby-keyword">true</span>,
            <span class="ruby-value">enumerable:</span> <span class="ruby-keyword">true</span>
          }
          <span class="ruby-identifier">type</span>, <span class="ruby-identifier">subtype</span> = <span class="ruby-identifier">get_type</span>(<span class="ruby-identifier">gv</span>)
          <span class="ruby-identifier">prop</span>[<span class="ruby-value">:value</span>][<span class="ruby-value">:type</span>] = <span class="ruby-identifier">type</span>
          <span class="ruby-identifier">prop</span>[<span class="ruby-value">:value</span>][<span class="ruby-value">:subtype</span>] = <span class="ruby-identifier">subtype</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">subtype</span>
          <span class="ruby-identifier">prop</span>
        <span class="ruby-keyword">end</span>

        <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">respond</span> <span class="ruby-identifier">req</span>, <span class="ruby-value">result:</span> <span class="ruby-identifier">vars</span>
        <span class="ruby-keyword">return</span> <span class="ruby-value">:retry</span>
      <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;properties&#39;</span>
        <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:cdp</span>, <span class="ruby-value">:properties</span>, <span class="ruby-identifier">req</span>, <span class="ruby-identifier">oid</span>]
      <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;exception&#39;</span>
        <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:cdp</span>, <span class="ruby-value">:exception</span>, <span class="ruby-identifier">req</span>, <span class="ruby-identifier">oid</span>]
      <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;script&#39;</span>
        <span class="ruby-comment"># TODO: Support script and global types</span>
        <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">respond</span> <span class="ruby-identifier">req</span>, <span class="ruby-value">result:</span> []
        <span class="ruby-keyword">return</span> <span class="ruby-value">:retry</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unknown type: #{ref.inspect}&quot;</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">fail_response</span> <span class="ruby-identifier">req</span>,
                    <span class="ruby-value">code:</span> <span class="ruby-constant">INVALID_PARAMS</span>,
                    <span class="ruby-value">message:</span> <span class="ruby-string">&quot;&#39;objectId&#39; is an invalid&quot;</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;Debugger.getScriptSource&#39;</span>
    <span class="ruby-identifier">s_id</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-string">&#39;params&#39;</span>, <span class="ruby-string">&#39;scriptId&#39;</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">src</span> = <span class="ruby-ivar">@src_map</span>[<span class="ruby-identifier">s_id</span>]
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">respond</span> <span class="ruby-identifier">req</span>, <span class="ruby-value">scriptSource:</span> <span class="ruby-identifier">src</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">fail_response</span> <span class="ruby-identifier">req</span>,
                    <span class="ruby-value">code:</span> <span class="ruby-constant">INVALID_PARAMS</span>,
                    <span class="ruby-value">message:</span> <span class="ruby-string">&quot;&#39;scriptId&#39; is an invalid&quot;</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">return</span> <span class="ruby-value">:retry</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;Debugger.getPossibleBreakpoints&#39;</span>
    <span class="ruby-identifier">s_id</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-string">&#39;params&#39;</span>, <span class="ruby-string">&#39;start&#39;</span>, <span class="ruby-string">&#39;scriptId&#39;</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">src</span> = <span class="ruby-ivar">@src_map</span>[<span class="ruby-identifier">s_id</span>]
      <span class="ruby-identifier">lineno</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-string">&#39;params&#39;</span>, <span class="ruby-string">&#39;start&#39;</span>, <span class="ruby-string">&#39;lineNumber&#39;</span>)
      <span class="ruby-identifier">end_line</span> = <span class="ruby-identifier">src</span>.<span class="ruby-identifier">lines</span>.<span class="ruby-identifier">count</span>
      <span class="ruby-identifier">lineno</span> = <span class="ruby-identifier">end_line</span>  <span class="ruby-keyword">if</span> <span class="ruby-identifier">lineno</span> <span class="ruby-operator">&gt;</span> <span class="ruby-identifier">end_line</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">respond</span> <span class="ruby-identifier">req</span>,
                  <span class="ruby-value">locations:</span> [{
                    <span class="ruby-value">scriptId:</span> <span class="ruby-identifier">s_id</span>,
                    <span class="ruby-value">lineNumber:</span> <span class="ruby-identifier">lineno</span>
                  }]
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">fail_response</span> <span class="ruby-identifier">req</span>,
                    <span class="ruby-value">code:</span> <span class="ruby-constant">INVALID_PARAMS</span>,
                    <span class="ruby-value">message:</span> <span class="ruby-string">&quot;&#39;scriptId&#39; is an invalid&quot;</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">return</span> <span class="ruby-value">:retry</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;Debugger.setBreakpointByUrl&#39;</span>
    <span class="ruby-identifier">path</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-string">&#39;params&#39;</span>, <span class="ruby-string">&#39;scriptId&#39;</span>)
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">s_id</span> = <span class="ruby-ivar">@scr_id_map</span>[<span class="ruby-identifier">path</span>]
      <span class="ruby-identifier">lineno</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-string">&#39;params&#39;</span>, <span class="ruby-string">&#39;lineNumber&#39;</span>)
      <span class="ruby-identifier">b_id</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-string">&#39;params&#39;</span>, <span class="ruby-string">&#39;breakpointId&#39;</span>)
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">respond</span> <span class="ruby-identifier">req</span>,
                  <span class="ruby-value">breakpointId:</span> <span class="ruby-identifier">b_id</span>,
                  <span class="ruby-value">locations:</span> [{
                      <span class="ruby-value">scriptId:</span> <span class="ruby-identifier">s_id</span>,
                      <span class="ruby-value">lineNumber:</span> <span class="ruby-identifier">lineno</span>
                  }]
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">fail_response</span> <span class="ruby-identifier">req</span>,
                    <span class="ruby-value">code:</span> <span class="ruby-constant">INTERNAL_ERROR</span>,
                    <span class="ruby-value">message:</span> <span class="ruby-string">&#39;The target script is not found...&#39;</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">return</span> <span class="ruby-value">:retry</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-process_protocol_result" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">process_protocol_result</span><span
                                class="method-args">(args)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="process_protocol_result-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_cdp.rb, line 840</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">process_protocol_result</span> <span class="ruby-identifier">args</span>
  <span class="ruby-identifier">type</span>, <span class="ruby-identifier">req</span>, <span class="ruby-identifier">result</span> = <span class="ruby-identifier">args</span>

  <span class="ruby-keyword">case</span> <span class="ruby-identifier">type</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:backtrace</span>
    <span class="ruby-identifier">result</span>[<span class="ruby-value">:callFrames</span>].<span class="ruby-identifier">each</span>.<span class="ruby-identifier">with_index</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">frame</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">frame_id</span> = <span class="ruby-identifier">frame</span>[<span class="ruby-value">:callFrameId</span>]
      <span class="ruby-ivar">@frame_map</span>[<span class="ruby-identifier">frame_id</span>] = <span class="ruby-identifier">i</span>
      <span class="ruby-identifier">path</span> = <span class="ruby-identifier">frame</span>[<span class="ruby-value">:url</span>]
      <span class="ruby-keyword">unless</span> <span class="ruby-identifier">s_id</span> = <span class="ruby-ivar">@scr_id_map</span>[<span class="ruby-identifier">path</span>]
        <span class="ruby-identifier">s_id</span> = (<span class="ruby-ivar">@scr_id_map</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>).<span class="ruby-identifier">to_s</span>
        <span class="ruby-ivar">@scr_id_map</span>[<span class="ruby-identifier">path</span>] = <span class="ruby-identifier">s_id</span>
        <span class="ruby-identifier">lineno</span> = <span class="ruby-value">0</span>
        <span class="ruby-identifier">src</span> = <span class="ruby-string">&#39;&#39;</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">exist?</span>(<span class="ruby-identifier">path</span>)
          <span class="ruby-identifier">src</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">read</span>(<span class="ruby-identifier">path</span>)
          <span class="ruby-ivar">@src_map</span>[<span class="ruby-identifier">s_id</span>] = <span class="ruby-identifier">src</span>
          <span class="ruby-identifier">lineno</span> = <span class="ruby-identifier">src</span>.<span class="ruby-identifier">lines</span>.<span class="ruby-identifier">count</span>
        <span class="ruby-keyword">end</span>
        <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">fire_event</span> <span class="ruby-string">&#39;Debugger.scriptParsed&#39;</span>,
                      <span class="ruby-value">scriptId:</span> <span class="ruby-identifier">s_id</span>,
                      <span class="ruby-value">url:</span> <span class="ruby-identifier">path</span>,
                      <span class="ruby-value">startLine:</span> <span class="ruby-value">0</span>,
                      <span class="ruby-value">startColumn:</span> <span class="ruby-value">0</span>,
                      <span class="ruby-value">endLine:</span> <span class="ruby-identifier">lineno</span>,
                      <span class="ruby-value">endColumn:</span> <span class="ruby-value">0</span>,
                      <span class="ruby-value">executionContextId:</span> <span class="ruby-value">1</span>,
                      <span class="ruby-value">hash:</span> <span class="ruby-identifier">src</span>.<span class="ruby-identifier">hash</span>.<span class="ruby-identifier">inspect</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">frame</span>[<span class="ruby-value">:location</span>][<span class="ruby-value">:scriptId</span>] = <span class="ruby-identifier">s_id</span>
      <span class="ruby-identifier">frame</span>[<span class="ruby-value">:functionLocation</span>][<span class="ruby-value">:scriptId</span>] = <span class="ruby-identifier">s_id</span>

      <span class="ruby-identifier">frame</span>[<span class="ruby-value">:scopeChain</span>].<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span>
        <span class="ruby-identifier">oid</span> = <span class="ruby-identifier">s</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-value">:object</span>, <span class="ruby-value">:objectId</span>)
        <span class="ruby-ivar">@obj_map</span>[<span class="ruby-identifier">oid</span>] = [<span class="ruby-identifier">s</span>[<span class="ruby-value">:type</span>], <span class="ruby-identifier">frame_id</span>]
      }
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">oid</span> = <span class="ruby-identifier">result</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-value">:data</span>, <span class="ruby-value">:objectId</span>)
      <span class="ruby-ivar">@obj_map</span>[<span class="ruby-identifier">oid</span>] = [<span class="ruby-string">&#39;properties&#39;</span>]
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">fire_event</span> <span class="ruby-string">&#39;Debugger.paused&#39;</span>, <span class="ruby-operator">**</span><span class="ruby-identifier">result</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:evaluate</span>
    <span class="ruby-identifier">message</span> = <span class="ruby-identifier">result</span>.<span class="ruby-identifier">delete</span> <span class="ruby-value">:message</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">message</span>
      <span class="ruby-identifier">fail_response</span> <span class="ruby-identifier">req</span>,
                    <span class="ruby-value">code:</span> <span class="ruby-constant">INVALID_PARAMS</span>,
                    <span class="ruby-value">message:</span> <span class="ruby-identifier">message</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">src</span> = <span class="ruby-identifier">req</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-string">&#39;params&#39;</span>, <span class="ruby-string">&#39;expression&#39;</span>)
      <span class="ruby-identifier">s_id</span> = (<span class="ruby-ivar">@src_map</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>).<span class="ruby-identifier">to_s</span>
      <span class="ruby-ivar">@src_map</span>[<span class="ruby-identifier">s_id</span>] = <span class="ruby-identifier">src</span>
      <span class="ruby-identifier">lineno</span> = <span class="ruby-identifier">src</span>.<span class="ruby-identifier">lines</span>.<span class="ruby-identifier">count</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">fire_event</span> <span class="ruby-string">&#39;Debugger.scriptParsed&#39;</span>,
                        <span class="ruby-value">scriptId:</span> <span class="ruby-identifier">s_id</span>,
                        <span class="ruby-value">url:</span> <span class="ruby-string">&#39;&#39;</span>,
                        <span class="ruby-value">startLine:</span> <span class="ruby-value">0</span>,
                        <span class="ruby-value">startColumn:</span> <span class="ruby-value">0</span>,
                        <span class="ruby-value">endLine:</span> <span class="ruby-identifier">lineno</span>,
                        <span class="ruby-value">endColumn:</span> <span class="ruby-value">0</span>,
                        <span class="ruby-value">executionContextId:</span> <span class="ruby-value">1</span>,
                        <span class="ruby-value">hash:</span> <span class="ruby-identifier">src</span>.<span class="ruby-identifier">hash</span>.<span class="ruby-identifier">inspect</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">exc</span> = <span class="ruby-identifier">result</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-value">:response</span>, <span class="ruby-value">:exceptionDetails</span>)
        <span class="ruby-identifier">exc</span>[<span class="ruby-value">:stackTrace</span>][<span class="ruby-value">:callFrames</span>].<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">frame</span><span class="ruby-operator">|</span>
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">frame</span>[<span class="ruby-value">:url</span>].<span class="ruby-identifier">empty?</span>
            <span class="ruby-identifier">frame</span>[<span class="ruby-value">:scriptId</span>] = <span class="ruby-identifier">s_id</span>
          <span class="ruby-keyword">else</span>
            <span class="ruby-identifier">path</span> = <span class="ruby-identifier">frame</span>[<span class="ruby-value">:url</span>]
            <span class="ruby-keyword">unless</span> <span class="ruby-identifier">s_id</span> = <span class="ruby-ivar">@scr_id_map</span>[<span class="ruby-identifier">path</span>]
              <span class="ruby-identifier">s_id</span> = (<span class="ruby-ivar">@scr_id_map</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>).<span class="ruby-identifier">to_s</span>
              <span class="ruby-ivar">@scr_id_map</span>[<span class="ruby-identifier">path</span>] = <span class="ruby-identifier">s_id</span>
            <span class="ruby-keyword">end</span>
            <span class="ruby-identifier">frame</span>[<span class="ruby-value">:scriptId</span>] = <span class="ruby-identifier">s_id</span>
          <span class="ruby-keyword">end</span>
        }
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">oid</span> = <span class="ruby-identifier">exc</span>[<span class="ruby-value">:exception</span>][<span class="ruby-value">:objectId</span>]
          <span class="ruby-ivar">@obj_map</span>[<span class="ruby-identifier">oid</span>] = [<span class="ruby-string">&#39;exception&#39;</span>]
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">rs</span> = <span class="ruby-identifier">result</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-value">:response</span>, <span class="ruby-value">:result</span>)
      [<span class="ruby-identifier">rs</span>].<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">oid</span> = <span class="ruby-identifier">obj</span>[<span class="ruby-value">:objectId</span>]
          <span class="ruby-ivar">@obj_map</span>[<span class="ruby-identifier">oid</span>] = [<span class="ruby-string">&#39;properties&#39;</span>]
        <span class="ruby-keyword">end</span>
      }
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">respond</span> <span class="ruby-identifier">req</span>, <span class="ruby-operator">**</span><span class="ruby-identifier">result</span>[<span class="ruby-value">:response</span>]

      <span class="ruby-identifier">out</span> = <span class="ruby-identifier">result</span>[<span class="ruby-value">:output</span>]
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">out</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">out</span>.<span class="ruby-identifier">empty?</span>
        <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">fire_event</span> <span class="ruby-string">&#39;Runtime.consoleAPICalled&#39;</span>,
                        <span class="ruby-value">type:</span> <span class="ruby-string">&#39;log&#39;</span>,
                        <span class="ruby-value">args:</span> [
                          <span class="ruby-value">type:</span> <span class="ruby-identifier">out</span>.<span class="ruby-identifier">class</span>,
                          <span class="ruby-value">value:</span> <span class="ruby-identifier">out</span>
                        ],
                        <span class="ruby-value">executionContextId:</span> <span class="ruby-value">1</span>, <span class="ruby-comment"># Change this number if something goes wrong.</span>
                        <span class="ruby-value">timestamp:</span> <span class="ruby-constant">Time</span>.<span class="ruby-identifier">now</span>.<span class="ruby-identifier">to_f</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:scope</span>
    <span class="ruby-identifier">result</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">oid</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-value">:value</span>, <span class="ruby-value">:objectId</span>)
        <span class="ruby-ivar">@obj_map</span>[<span class="ruby-identifier">oid</span>] = [<span class="ruby-string">&#39;properties&#39;</span>]
      <span class="ruby-keyword">end</span>
    }
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">respond</span> <span class="ruby-identifier">req</span>, <span class="ruby-value">result:</span> <span class="ruby-identifier">result</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:properties</span>
    <span class="ruby-identifier">result</span>.<span class="ruby-identifier">each_value</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">v</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">obj</span><span class="ruby-operator">|</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">oid</span> = <span class="ruby-identifier">obj</span>.<span class="ruby-identifier">dig</span>(<span class="ruby-value">:value</span>, <span class="ruby-value">:objectId</span>)
          <span class="ruby-ivar">@obj_map</span>[<span class="ruby-identifier">oid</span>] = [<span class="ruby-string">&#39;properties&#39;</span>]
        <span class="ruby-keyword">end</span>
      }
    }
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">respond</span> <span class="ruby-identifier">req</span>, <span class="ruby-operator">**</span><span class="ruby-identifier">result</span>
  <span class="ruby-keyword">when</span> <span class="ruby-value">:exception</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">respond</span> <span class="ruby-identifier">req</span>, <span class="ruby-operator">**</span><span class="ruby-identifier">result</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-prompt" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">prompt</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="prompt-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 400</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">prompt</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@postmortem</span>
    <span class="ruby-string">&#39;(rdbg:postmortem) &#39;</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-ivar">@process_group</span>.<span class="ruby-identifier">multi?</span>
    <span class="ruby-node">&quot;(rdbg@#{process_info}) &quot;</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-string">&#39;(rdbg) &#39;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-register_default_command" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">register_default_command</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="register_default_command-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 451</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">register_default_command</span>
  <span class="ruby-comment">### Control flow</span>

  <span class="ruby-comment"># * `s[tep]`</span>
  <span class="ruby-comment">#   * Step in. Resume the program until next breakable point.</span>
  <span class="ruby-comment"># * `s[tep] &lt;n&gt;`</span>
  <span class="ruby-comment">#   * Step in, resume the program at `&lt;n&gt;`th breakable point.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;s&#39;</span>, <span class="ruby-string">&#39;step&#39;</span>,
                   <span class="ruby-value">repeat:</span> <span class="ruby-keyword">true</span>,
                   <span class="ruby-value">cancel_auto_continue:</span> <span class="ruby-keyword">true</span>,
                   <span class="ruby-value">postmortem:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">step_command</span> <span class="ruby-value">:in</span>, <span class="ruby-identifier">arg</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `n[ext]`</span>
  <span class="ruby-comment">#   * Step over. Resume the program until next line.</span>
  <span class="ruby-comment"># * `n[ext] &lt;n&gt;`</span>
  <span class="ruby-comment">#   * Step over, same as `step &lt;n&gt;`.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;n&#39;</span>, <span class="ruby-string">&#39;next&#39;</span>,
                   <span class="ruby-value">repeat:</span> <span class="ruby-keyword">true</span>,
                   <span class="ruby-value">cancel_auto_continue:</span> <span class="ruby-keyword">true</span>,
                   <span class="ruby-value">postmortem:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">step_command</span> <span class="ruby-value">:next</span>, <span class="ruby-identifier">arg</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `fin[ish]`</span>
  <span class="ruby-comment">#   * Finish this frame. Resume the program until the current frame is finished.</span>
  <span class="ruby-comment"># * `fin[ish] &lt;n&gt;`</span>
  <span class="ruby-comment">#   * Finish `&lt;n&gt;`th frames.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;fin&#39;</span>, <span class="ruby-string">&#39;finish&#39;</span>,
                   <span class="ruby-value">repeat:</span> <span class="ruby-keyword">true</span>,
                   <span class="ruby-value">cancel_auto_continue:</span> <span class="ruby-keyword">true</span>,
                   <span class="ruby-value">postmortem:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span>&amp;.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;finish command with 0 does not make sense.&#39;</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">step_command</span> <span class="ruby-value">:finish</span>, <span class="ruby-identifier">arg</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `u[ntil]`</span>
  <span class="ruby-comment">#   * Similar to `next` command, but only stop later lines or the end of the current frame.</span>
  <span class="ruby-comment">#   * Similar to gdb&#39;s `advance` command.</span>
  <span class="ruby-comment"># * `u[ntil] &lt;[file:]line&gt;`</span>
  <span class="ruby-comment">#   * Run til the program reaches given location or the end of the current frame.</span>
  <span class="ruby-comment"># * `u[ntil] &lt;name&gt;`</span>
  <span class="ruby-comment">#   * Run til the program invokes a method `&lt;name&gt;`. `&lt;name&gt;` can be a regexp with `/name/`.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;u&#39;</span>, <span class="ruby-string">&#39;until&#39;</span>,
                   <span class="ruby-value">repeat:</span> <span class="ruby-keyword">true</span>,
                   <span class="ruby-value">cancel_auto_continue:</span> <span class="ruby-keyword">true</span>,
                   <span class="ruby-value">postmortem:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>

    <span class="ruby-identifier">step_command</span> <span class="ruby-value">:until</span>, <span class="ruby-identifier">arg</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `c` or `cont` or `continue`</span>
  <span class="ruby-comment">#   * Resume the program.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;c&#39;</span>, <span class="ruby-string">&#39;cont&#39;</span>, <span class="ruby-string">&#39;continue&#39;</span>,
                   <span class="ruby-value">repeat:</span> <span class="ruby-keyword">true</span>,
                   <span class="ruby-value">cancel_auto_continue:</span> <span class="ruby-keyword">true</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">leave_subsession</span> <span class="ruby-value">:continue</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `q[uit]` or `Ctrl-D`</span>
  <span class="ruby-comment">#   * Finish debugger (with the debuggee process on non-remote debugging).</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;q&#39;</span>, <span class="ruby-string">&#39;quit&#39;</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">ask</span> <span class="ruby-string">&#39;Really quit?&#39;</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">quit</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-keyword">do</span>
        <span class="ruby-identifier">request_tc</span> <span class="ruby-value">:quit</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">leave_subsession</span> <span class="ruby-value">:continue</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">next</span> <span class="ruby-value">:retry</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `q[uit]!`</span>
  <span class="ruby-comment">#   * Same as q[uit] but without the confirmation prompt.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;q!&#39;</span>, <span class="ruby-string">&#39;quit!&#39;</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">quit</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-keyword">do</span>
      <span class="ruby-identifier">request_tc</span> <span class="ruby-value">:quit</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">leave_subsession</span> <span class="ruby-value">:continue</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `kill`</span>
  <span class="ruby-comment">#   * Stop the debuggee process with `Kernel#exit!`.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;kill&#39;</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">ask</span> <span class="ruby-string">&#39;Really kill?&#39;</span>
      <span class="ruby-identifier">exit!</span> (<span class="ruby-identifier">arg</span> <span class="ruby-operator">||</span> <span class="ruby-value">1</span>).<span class="ruby-identifier">to_i</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">next</span> <span class="ruby-value">:retry</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `kill!`</span>
  <span class="ruby-comment">#   * Same as kill but without the confirmation prompt.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;kill!&#39;</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">exit!</span> (<span class="ruby-identifier">arg</span> <span class="ruby-operator">||</span> <span class="ruby-value">1</span>).<span class="ruby-identifier">to_i</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `sigint`</span>
  <span class="ruby-comment">#   * Execute SIGINT handler registered by the debuggee.</span>
  <span class="ruby-comment">#   * Note that this command should be used just after stop by `SIGINT`.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;sigint&#39;</span> <span class="ruby-keyword">do</span>
    <span class="ruby-keyword">begin</span>
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">cmd</span> = <span class="ruby-ivar">@intercepted_sigint_cmd</span>
      <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>, <span class="ruby-string">&#39;IGNORE&#39;</span>, <span class="ruby-value">:IGNORE</span>, <span class="ruby-string">&#39;DEFAULT&#39;</span>, <span class="ruby-value">:DEFAULT</span>
        <span class="ruby-comment"># ignore</span>
      <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span>
        <span class="ruby-identifier">eval</span>(<span class="ruby-identifier">cmd</span>)
      <span class="ruby-keyword">when</span> <span class="ruby-constant">Proc</span>
        <span class="ruby-identifier">cmd</span>.<span class="ruby-identifier">call</span>
      <span class="ruby-keyword">end</span>

      <span class="ruby-identifier">leave_subsession</span> <span class="ruby-value">:continue</span>

    <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Exception: #{e}&quot;</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span> <span class="ruby-node">&quot;  #{e}&quot;</span>}
      <span class="ruby-keyword">next</span> <span class="ruby-value">:retry</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment">### Breakpoint</span>

  <span class="ruby-comment"># * `b[reak]`</span>
  <span class="ruby-comment">#   * Show all breakpoints.</span>
  <span class="ruby-comment"># * `b[reak] &lt;line&gt;`</span>
  <span class="ruby-comment">#   * Set breakpoint on `&lt;line&gt;` at the current frame&#39;s file.</span>
  <span class="ruby-comment"># * `b[reak] &lt;file&gt;:&lt;line&gt;` or `&lt;file&gt; &lt;line&gt;`</span>
  <span class="ruby-comment">#   * Set breakpoint on `&lt;file&gt;:&lt;line&gt;`.</span>
  <span class="ruby-comment"># * `b[reak] &lt;class&gt;#&lt;name&gt;`</span>
  <span class="ruby-comment">#    * Set breakpoint on the method `&lt;class&gt;#&lt;name&gt;`.</span>
  <span class="ruby-comment"># * `b[reak] &lt;expr&gt;.&lt;name&gt;`</span>
  <span class="ruby-comment">#    * Set breakpoint on the method `&lt;expr&gt;.&lt;name&gt;`.</span>
  <span class="ruby-comment"># * `b[reak] ... if: &lt;expr&gt;`</span>
  <span class="ruby-comment">#   * break if `&lt;expr&gt;` is true at specified location.</span>
  <span class="ruby-comment"># * `b[reak] ... pre: &lt;command&gt;`</span>
  <span class="ruby-comment">#   * break and run `&lt;command&gt;` before stopping.</span>
  <span class="ruby-comment"># * `b[reak] ... do: &lt;command&gt;`</span>
  <span class="ruby-comment">#   * break and run `&lt;command&gt;`, and continue.</span>
  <span class="ruby-comment"># * `b[reak] ... path: &lt;path&gt;`</span>
  <span class="ruby-comment">#   * break if the path matches to `&lt;path&gt;`. `&lt;path&gt;` can be a regexp with `/regexp/`.</span>
  <span class="ruby-comment"># * `b[reak] if: &lt;expr&gt;`</span>
  <span class="ruby-comment">#   * break if: `&lt;expr&gt;` is true at any lines.</span>
  <span class="ruby-comment">#   * Note that this feature is super slow.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;b&#39;</span>, <span class="ruby-string">&#39;break&#39;</span>, <span class="ruby-value">postmortem:</span> <span class="ruby-keyword">false</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span>
      <span class="ruby-identifier">show_bps</span>
      <span class="ruby-keyword">next</span> <span class="ruby-value">:retry</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">case</span> <span class="ruby-identifier">bp</span> = <span class="ruby-identifier">repl_add_breakpoint</span>(<span class="ruby-identifier">arg</span>)
      <span class="ruby-keyword">when</span> <span class="ruby-value">:noretry</span>
      <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>
        <span class="ruby-keyword">next</span> <span class="ruby-value">:retry</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-identifier">show_bps</span> <span class="ruby-identifier">bp</span>
        <span class="ruby-keyword">next</span> <span class="ruby-value">:retry</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `catch &lt;Error&gt;`</span>
  <span class="ruby-comment">#   * Set breakpoint on raising `&lt;Error&gt;`.</span>
  <span class="ruby-comment"># * `catch ... if: &lt;expr&gt;`</span>
  <span class="ruby-comment">#   * stops only if `&lt;expr&gt;` is true as well.</span>
  <span class="ruby-comment"># * `catch ... pre: &lt;command&gt;`</span>
  <span class="ruby-comment">#   * runs `&lt;command&gt;` before stopping.</span>
  <span class="ruby-comment"># * `catch ... do: &lt;command&gt;`</span>
  <span class="ruby-comment">#   * stops and run `&lt;command&gt;`, and continue.</span>
  <span class="ruby-comment"># * `catch ... path: &lt;path&gt;`</span>
  <span class="ruby-comment">#   * stops if the exception is raised from a `&lt;path&gt;`. `&lt;path&gt;` can be a regexp with `/regexp/`.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;catch&#39;</span>, <span class="ruby-value">postmortem:</span> <span class="ruby-keyword">false</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span>
      <span class="ruby-identifier">bp</span> = <span class="ruby-identifier">repl_add_catch_breakpoint</span> <span class="ruby-identifier">arg</span>
      <span class="ruby-identifier">show_bps</span> <span class="ruby-identifier">bp</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">bp</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">show_bps</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-value">:retry</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `watch @ivar`</span>
  <span class="ruby-comment">#   * Stop the execution when the result of current scope&#39;s `@ivar` is changed.</span>
  <span class="ruby-comment">#   * Note that this feature is super slow.</span>
  <span class="ruby-comment"># * `watch ... if: &lt;expr&gt;`</span>
  <span class="ruby-comment">#   * stops only if `&lt;expr&gt;` is true as well.</span>
  <span class="ruby-comment"># * `watch ... pre: &lt;command&gt;`</span>
  <span class="ruby-comment">#   * runs `&lt;command&gt;` before stopping.</span>
  <span class="ruby-comment"># * `watch ... do: &lt;command&gt;`</span>
  <span class="ruby-comment">#   * stops and run `&lt;command&gt;`, and continue.</span>
  <span class="ruby-comment"># * `watch ... path: &lt;path&gt;`</span>
  <span class="ruby-comment">#   * stops if the path matches `&lt;path&gt;`. `&lt;path&gt;` can be a regexp with `/regexp/`.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;wat&#39;</span>, <span class="ruby-string">&#39;watch&#39;</span>, <span class="ruby-value">postmortem:</span> <span class="ruby-keyword">false</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">match?</span>(<span class="ruby-regexp">/\A@\w+/</span>)
      <span class="ruby-identifier">repl_add_watch_breakpoint</span>(<span class="ruby-identifier">arg</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">show_bps</span>
      <span class="ruby-value">:retry</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `del[ete]`</span>
  <span class="ruby-comment">#   * delete all breakpoints.</span>
  <span class="ruby-comment"># * `del[ete] &lt;bpnum&gt;`</span>
  <span class="ruby-comment">#   * delete specified breakpoint.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;del&#39;</span>, <span class="ruby-string">&#39;delete&#39;</span>, <span class="ruby-value">postmortem:</span> <span class="ruby-keyword">false</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">arg</span>
    <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>
      <span class="ruby-identifier">show_bps</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">ask</span> <span class="ruby-string">&quot;Remove all breakpoints?&quot;</span>, <span class="ruby-string">&#39;N&#39;</span>
        <span class="ruby-identifier">delete_bp</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\d+/</span>
      <span class="ruby-identifier">bp</span> = <span class="ruby-identifier">delete_bp</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">to_i</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;deleted: \##{bp[0]} #{bp[1]}&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">bp</span>
    <span class="ruby-value">:retry</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment">### Information</span>

  <span class="ruby-comment"># * `bt` or `backtrace`</span>
  <span class="ruby-comment">#   * Show backtrace (frame) information.</span>
  <span class="ruby-comment"># * `bt &lt;num&gt;` or `backtrace &lt;num&gt;`</span>
  <span class="ruby-comment">#   * Only shows first `&lt;num&gt;` frames.</span>
  <span class="ruby-comment"># * `bt /regexp/` or `backtrace /regexp/`</span>
  <span class="ruby-comment">#   * Only shows frames with method name or location info that matches `/regexp/`.</span>
  <span class="ruby-comment"># * `bt &lt;num&gt; /regexp/` or `backtrace &lt;num&gt; /regexp/`</span>
  <span class="ruby-comment">#   * Only shows first `&lt;num&gt;` frames with method name or location info that matches `/regexp/`.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;bt&#39;</span>, <span class="ruby-string">&#39;backtrace&#39;</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">arg</span>
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A(\d+)\z/</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:show</span>, <span class="ruby-value">:backtrace</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-keyword">nil</span>]
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A\/(.*)\/\z/</span>
      <span class="ruby-identifier">pattern</span> = <span class="ruby-node">$1</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:show</span>, <span class="ruby-value">:backtrace</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">compile</span>(<span class="ruby-identifier">pattern</span>)]
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A(\d+)\s+\/(.*)\/\z/</span>
      <span class="ruby-identifier">max</span>, <span class="ruby-identifier">pattern</span> = <span class="ruby-node">$1</span>, <span class="ruby-node">$2</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:show</span>, <span class="ruby-value">:backtrace</span>, <span class="ruby-identifier">max</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">compile</span>(<span class="ruby-identifier">pattern</span>)]
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:show</span>, <span class="ruby-value">:backtrace</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-keyword">nil</span>]
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `l[ist]`</span>
  <span class="ruby-comment">#   * Show current frame&#39;s source code.</span>
  <span class="ruby-comment">#   * Next `list` command shows the successor lines.</span>
  <span class="ruby-comment"># * `l[ist] -`</span>
  <span class="ruby-comment">#   * Show predecessor lines as opposed to the `list` command.</span>
  <span class="ruby-comment"># * `l[ist] &lt;start&gt;` or `l[ist] &lt;start&gt;-&lt;end&gt;`</span>
  <span class="ruby-comment">#   * Show current frame&#39;s source code from the line &lt;start&gt; to &lt;end&gt; if given.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;l&#39;</span>, <span class="ruby-string">&#39;list&#39;</span>, <span class="ruby-value">repeat:</span> <span class="ruby-keyword">true</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">strip</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">nil</span>
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A(\d+)\z/</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:show</span>, <span class="ruby-value">:list</span>, {<span class="ruby-value">start_line:</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>}]
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A-\z/</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:show</span>, <span class="ruby-value">:list</span>, {<span class="ruby-value">dir:</span> <span class="ruby-value">-1</span>}]
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A(\d+)-(\d+)\z/</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:show</span>, <span class="ruby-value">:list</span>, {<span class="ruby-value">start_line:</span> <span class="ruby-node">$1</span>.<span class="ruby-identifier">to_i</span> <span class="ruby-operator">-</span> <span class="ruby-value">1</span>, <span class="ruby-value">end_line:</span> <span class="ruby-node">$2</span>.<span class="ruby-identifier">to_i</span>}]
    <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:show</span>, <span class="ruby-value">:list</span>]
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Can not handle list argument: #{arg}&quot;</span>
      <span class="ruby-value">:retry</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `whereami`</span>
  <span class="ruby-comment">#   * Show the current frame with source code.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;whereami&#39;</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:show</span>, <span class="ruby-value">:whereami</span>]
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `edit`</span>
  <span class="ruby-comment">#   * Open the current file on the editor (use `EDITOR` environment variable).</span>
  <span class="ruby-comment">#   * Note that edited file will not be reloaded.</span>
  <span class="ruby-comment"># * `edit &lt;file&gt;`</span>
  <span class="ruby-comment">#   * Open &lt;file&gt; on the editor.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;edit&#39;</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">remote?</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;not supported on the remote console.&quot;</span>
      <span class="ruby-keyword">next</span> <span class="ruby-value">:retry</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">begin</span>
      <span class="ruby-identifier">arg</span> = <span class="ruby-identifier">resolve_path</span>(<span class="ruby-identifier">arg</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span>
    <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ENOENT</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;not found: #{arg}&quot;</span>
      <span class="ruby-keyword">next</span> <span class="ruby-value">:retry</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:show</span>, <span class="ruby-value">:edit</span>, <span class="ruby-identifier">arg</span>]
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">info_subcommands</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">info_subcommands_abbrev</span> = <span class="ruby-keyword">nil</span>

  <span class="ruby-comment"># * `i[nfo]`</span>
  <span class="ruby-comment">#   * Show information about current frame (local/instance variables and defined constants).</span>
  <span class="ruby-comment"># * `i[nfo]` &lt;subcommand&gt;</span>
  <span class="ruby-comment">#   * `info` has the following sub-commands.</span>
  <span class="ruby-comment">#   * Sub-commands can be specified with few letters which is unambiguous, like `l` for &#39;locals&#39;.</span>
  <span class="ruby-comment"># * `i[nfo] l or locals or local_variables`</span>
  <span class="ruby-comment">#   * Show information about the current frame (local variables)</span>
  <span class="ruby-comment">#   * It includes `self` as `%self` and a return value as `_return`.</span>
  <span class="ruby-comment"># * `i[nfo] i or ivars or instance_variables`</span>
  <span class="ruby-comment">#   * Show information about instance variables about `self`.</span>
  <span class="ruby-comment">#   * `info ivars &lt;expr&gt;` shows the instance variables of the result of `&lt;expr&gt;`.</span>
  <span class="ruby-comment"># * `i[nfo] c or consts or constants`</span>
  <span class="ruby-comment">#   * Show information about accessible constants except toplevel constants.</span>
  <span class="ruby-comment">#   * `info consts &lt;expr&gt;` shows the constants of a class/module of the result of `&lt;expr&gt;`</span>
  <span class="ruby-comment"># * `i[nfo] g or globals or global_variables`</span>
  <span class="ruby-comment">#   * Show information about global variables</span>
  <span class="ruby-comment"># * `i[nfo] th or threads`</span>
  <span class="ruby-comment">#   * Show all threads (same as `th[read]`).</span>
  <span class="ruby-comment"># * `i[nfo] b or breakpoints or w or watchpoints`</span>
  <span class="ruby-comment">#   * Show all breakpoints and watchpoints.</span>
  <span class="ruby-comment"># * `i[nfo] ... /regexp/`</span>
  <span class="ruby-comment">#   * Filter the output with `/regexp/`.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;i&#39;</span>, <span class="ruby-string">&#39;info&#39;</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-regexp">/\/(.+)\/\z/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">arg</span>
      <span class="ruby-identifier">pat</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">compile</span>(<span class="ruby-node">$1</span>)
      <span class="ruby-identifier">sub</span> = <span class="ruby-identifier">$~</span>.<span class="ruby-identifier">pre_match</span>.<span class="ruby-identifier">strip</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">sub</span> = <span class="ruby-identifier">arg</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> <span class="ruby-regexp">/\A(.+?)\b(.+)/</span> <span class="ruby-operator">=~</span> <span class="ruby-identifier">sub</span>
      <span class="ruby-identifier">sub</span> = <span class="ruby-node">$1</span>
      <span class="ruby-identifier">opt</span> = <span class="ruby-node">$2</span>.<span class="ruby-identifier">strip</span>
      <span class="ruby-identifier">opt</span> = <span class="ruby-keyword">nil</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">opt</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">sub</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">info_subcommands</span>
      <span class="ruby-identifier">info_subcommands</span> = {
        <span class="ruby-value">locals:</span> <span class="ruby-node">%w[ locals local_variables ]</span>,
        <span class="ruby-value">ivars:</span>  <span class="ruby-node">%w[ ivars instance_variables ]</span>,
        <span class="ruby-value">consts:</span> <span class="ruby-node">%w[ consts constants ]</span>,
        <span class="ruby-value">globals:</span><span class="ruby-node">%w[ globals global_variables ]</span>,
        <span class="ruby-value">threads:</span><span class="ruby-node">%w[ threads ]</span>,
        <span class="ruby-value">breaks:</span> <span class="ruby-node">%w[ breakpoints ]</span>,
        <span class="ruby-value">watchs:</span> <span class="ruby-node">%w[ watchpoints ]</span>,
      }

      <span class="ruby-identifier">require_relative</span> <span class="ruby-string">&#39;abbrev_command&#39;</span>
      <span class="ruby-identifier">info_subcommands_abbrev</span> = <span class="ruby-constant">AbbrevCommand</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">info_subcommands</span>)
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> <span class="ruby-identifier">sub</span>
      <span class="ruby-identifier">sub</span> = <span class="ruby-identifier">info_subcommands_abbrev</span>.<span class="ruby-identifier">search</span> <span class="ruby-identifier">sub</span>, <span class="ruby-value">:unknown</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">candidates</span><span class="ruby-operator">|</span>
        <span class="ruby-comment"># note: unreached now</span>
        <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Ambiguous command &#39;#{sub}&#39;: #{candidates.join(&#39; &#39;)}&quot;</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">case</span> <span class="ruby-identifier">sub</span>
    <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:show</span>, <span class="ruby-value">:default</span>, <span class="ruby-identifier">pat</span>] <span class="ruby-comment"># something useful</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:locals</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:show</span>, <span class="ruby-value">:locals</span>, <span class="ruby-identifier">pat</span>]
    <span class="ruby-keyword">when</span> <span class="ruby-value">:ivars</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:show</span>, <span class="ruby-value">:ivars</span>, <span class="ruby-identifier">pat</span>, <span class="ruby-identifier">opt</span>]
    <span class="ruby-keyword">when</span> <span class="ruby-value">:consts</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:show</span>, <span class="ruby-value">:consts</span>, <span class="ruby-identifier">pat</span>, <span class="ruby-identifier">opt</span>]
    <span class="ruby-keyword">when</span> <span class="ruby-value">:globals</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:show</span>, <span class="ruby-value">:globals</span>, <span class="ruby-identifier">pat</span>]
    <span class="ruby-keyword">when</span> <span class="ruby-value">:threads</span>
      <span class="ruby-identifier">thread_list</span>
      <span class="ruby-value">:retry</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:breaks</span>, <span class="ruby-value">:watchs</span>
      <span class="ruby-identifier">show_bps</span>
      <span class="ruby-value">:retry</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;unrecognized argument for info command: #{arg}&quot;</span>
      <span class="ruby-identifier">show_help</span> <span class="ruby-string">&#39;info&#39;</span>
      <span class="ruby-value">:retry</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `o[utline]` or `ls`</span>
  <span class="ruby-comment">#   * Show you available methods, constants, local variables, and instance variables in the current scope.</span>
  <span class="ruby-comment"># * `o[utline] &lt;expr&gt;` or `ls &lt;expr&gt;`</span>
  <span class="ruby-comment">#   * Show you available methods and instance variables of the given object.</span>
  <span class="ruby-comment">#   * If the object is a class/module, it also lists its constants.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;outline&#39;</span>, <span class="ruby-string">&#39;o&#39;</span>, <span class="ruby-string">&#39;ls&#39;</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:show</span>, <span class="ruby-value">:outline</span>, <span class="ruby-identifier">arg</span>]
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `display`</span>
  <span class="ruby-comment">#   * Show display setting.</span>
  <span class="ruby-comment"># * `display &lt;expr&gt;`</span>
  <span class="ruby-comment">#   * Show the result of `&lt;expr&gt;` at every suspended timing.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;display&#39;</span>, <span class="ruby-value">postmortem:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-operator">!</span><span class="ruby-identifier">arg</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-ivar">@displays</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">arg</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:eval</span>, <span class="ruby-value">:try_display</span>, <span class="ruby-ivar">@displays</span>]
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:eval</span>, <span class="ruby-value">:display</span>, <span class="ruby-ivar">@displays</span>]
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `undisplay`</span>
  <span class="ruby-comment">#   * Remove all display settings.</span>
  <span class="ruby-comment"># * `undisplay &lt;displaynum&gt;`</span>
  <span class="ruby-comment">#   * Remove a specified display setting.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;undisplay&#39;</span>, <span class="ruby-value">postmortem:</span> <span class="ruby-keyword">false</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">arg</span>
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/(\d+)/</span>
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@displays</span>[<span class="ruby-identifier">n</span> = <span class="ruby-node">$1</span>.<span class="ruby-identifier">to_i</span>]
        <span class="ruby-ivar">@displays</span>.<span class="ruby-identifier">delete_at</span> <span class="ruby-identifier">n</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:eval</span>, <span class="ruby-value">:display</span>, <span class="ruby-ivar">@displays</span>]
    <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">ask</span> <span class="ruby-string">&quot;clear all?&quot;</span>, <span class="ruby-string">&#39;N&#39;</span>
        <span class="ruby-ivar">@displays</span>.<span class="ruby-identifier">clear</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-value">:retry</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment">### Frame control</span>

  <span class="ruby-comment"># * `f[rame]`</span>
  <span class="ruby-comment">#   * Show the current frame.</span>
  <span class="ruby-comment"># * `f[rame] &lt;framenum&gt;`</span>
  <span class="ruby-comment">#   * Specify a current frame. Evaluation are run on specified frame.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;frame&#39;</span>, <span class="ruby-string">&#39;f&#39;</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:frame</span>, <span class="ruby-value">:set</span>, <span class="ruby-identifier">arg</span>]
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `up`</span>
  <span class="ruby-comment">#   * Specify the upper frame.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;up&#39;</span>, <span class="ruby-value">repeat:</span> <span class="ruby-keyword">true</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:frame</span>, <span class="ruby-value">:up</span>]
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `down`</span>
  <span class="ruby-comment">#   * Specify the lower frame.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;down&#39;</span>, <span class="ruby-value">repeat:</span> <span class="ruby-keyword">true</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:frame</span>, <span class="ruby-value">:down</span>]
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment">### Evaluate</span>

  <span class="ruby-comment"># * `p &lt;expr&gt;`</span>
  <span class="ruby-comment">#   * Evaluate like `p &lt;expr&gt;` on the current frame.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;p&#39;</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">request_eval</span> <span class="ruby-value">:p</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `pp &lt;expr&gt;`</span>
  <span class="ruby-comment">#   * Evaluate like `pp &lt;expr&gt;` on the current frame.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;pp&#39;</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">request_eval</span> <span class="ruby-value">:pp</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `eval &lt;expr&gt;`</span>
  <span class="ruby-comment">#   * Evaluate `&lt;expr&gt;` on the current frame.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;eval&#39;</span>, <span class="ruby-string">&#39;call&#39;</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span> <span class="ruby-operator">==</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-identifier">show_help</span> <span class="ruby-string">&#39;eval&#39;</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;\nTo evaluate the variable `#{cmd}`, use `pp #{cmd}` instead.&quot;</span>
      <span class="ruby-value">:retry</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">request_eval</span> <span class="ruby-value">:call</span>, <span class="ruby-identifier">arg</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `irb`</span>
  <span class="ruby-comment">#   * Invoke `irb` on the current frame.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;irb&#39;</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">remote?</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;not supported on the remote console.&quot;</span>
      <span class="ruby-value">:retry</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-identifier">request_eval</span> <span class="ruby-value">:irb</span>, <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment">### Trace</span>
  <span class="ruby-comment"># * `trace`</span>
  <span class="ruby-comment">#   * Show available tracers list.</span>
  <span class="ruby-comment"># * `trace line`</span>
  <span class="ruby-comment">#   * Add a line tracer. It indicates line events.</span>
  <span class="ruby-comment"># * `trace call`</span>
  <span class="ruby-comment">#   * Add a call tracer. It indicate call/return events.</span>
  <span class="ruby-comment"># * `trace exception`</span>
  <span class="ruby-comment">#   * Add an exception tracer. It indicates raising exceptions.</span>
  <span class="ruby-comment"># * `trace object &lt;expr&gt;`</span>
  <span class="ruby-comment">#   * Add an object tracer. It indicates that an object by `&lt;expr&gt;` is passed as a parameter or a receiver on method call.</span>
  <span class="ruby-comment"># * `trace ... /regexp/`</span>
  <span class="ruby-comment">#   * Indicates only matched events to `/regexp/`.</span>
  <span class="ruby-comment"># * `trace ... into: &lt;file&gt;`</span>
  <span class="ruby-comment">#   * Save trace information into: `&lt;file&gt;`.</span>
  <span class="ruby-comment"># * `trace off &lt;num&gt;`</span>
  <span class="ruby-comment">#   * Disable tracer specified by `&lt;num&gt;` (use `trace` command to check the numbers).</span>
  <span class="ruby-comment"># * `trace off [line|call|pass]`</span>
  <span class="ruby-comment">#   * Disable all tracers. If `&lt;type&gt;` is provided, disable specified type tracers.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;trace&#39;</span>, <span class="ruby-value">postmortem:</span> <span class="ruby-keyword">false</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> (<span class="ruby-identifier">re</span> = <span class="ruby-regexp">/\s+into:\s*(.+)/</span>) <span class="ruby-operator">=~</span> <span class="ruby-identifier">arg</span>
      <span class="ruby-identifier">into</span> = <span class="ruby-node">$1</span>
      <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-identifier">re</span>, <span class="ruby-string">&#39;&#39;</span>)
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">if</span> (<span class="ruby-identifier">re</span> = <span class="ruby-regexp">/\s\/(.+)\/\z/</span>) <span class="ruby-operator">=~</span> <span class="ruby-identifier">arg</span>
      <span class="ruby-identifier">pattern</span> = <span class="ruby-node">$1</span>
      <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-identifier">re</span>, <span class="ruby-string">&#39;&#39;</span>)
    <span class="ruby-keyword">end</span>

    <span class="ruby-keyword">case</span> <span class="ruby-identifier">arg</span>
    <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&#39;Tracers:&#39;</span>
      <span class="ruby-ivar">@tracers</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each_with_index</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">t</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
        <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;* \##{i} #{t}&quot;</span>
      }
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span>
      <span class="ruby-value">:retry</span>

    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\Aline\z/</span>
      <span class="ruby-identifier">add_tracer</span> <span class="ruby-constant">LineTracer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@ui</span>, <span class="ruby-value">pattern:</span> <span class="ruby-identifier">pattern</span>, <span class="ruby-value">into:</span> <span class="ruby-identifier">into</span>)
      <span class="ruby-value">:retry</span>

    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\Acall\z/</span>
      <span class="ruby-identifier">add_tracer</span> <span class="ruby-constant">CallTracer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@ui</span>, <span class="ruby-value">pattern:</span> <span class="ruby-identifier">pattern</span>, <span class="ruby-value">into:</span> <span class="ruby-identifier">into</span>)
      <span class="ruby-value">:retry</span>

    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\Aexception\z/</span>
      <span class="ruby-identifier">add_tracer</span> <span class="ruby-constant">ExceptionTracer</span>.<span class="ruby-identifier">new</span>(<span class="ruby-ivar">@ui</span>, <span class="ruby-value">pattern:</span> <span class="ruby-identifier">pattern</span>, <span class="ruby-value">into:</span> <span class="ruby-identifier">into</span>)
      <span class="ruby-value">:retry</span>

    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\Aobject\s+(.+)/</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:trace</span>, <span class="ruby-value">:object</span>, <span class="ruby-node">$1</span>.<span class="ruby-identifier">strip</span>, {<span class="ruby-value">pattern:</span> <span class="ruby-identifier">pattern</span>, <span class="ruby-value">into:</span> <span class="ruby-identifier">into</span>}]

    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\Aoff\s+(\d+)\z/</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">t</span> = <span class="ruby-ivar">@tracers</span>.<span class="ruby-identifier">values</span>[<span class="ruby-node">$1</span>.<span class="ruby-identifier">to_i</span>]
        <span class="ruby-identifier">t</span>.<span class="ruby-identifier">disable</span>
        <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Disable #{t.to_s}&quot;</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Unmatched: #{$1}&quot;</span>
      <span class="ruby-keyword">end</span>
      <span class="ruby-value">:retry</span>

    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\Aoff(\s+(line|call|exception|object))?\z/</span>
      <span class="ruby-ivar">@tracers</span>.<span class="ruby-identifier">values</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span>
        <span class="ruby-keyword">if</span> <span class="ruby-node">$2</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-node">$2</span>
          <span class="ruby-identifier">t</span>.<span class="ruby-identifier">disable</span>
          <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Disable #{t.to_s}&quot;</span>
        <span class="ruby-keyword">end</span>
      }
      <span class="ruby-value">:retry</span>

    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Unknown trace option: #{arg.inspect}&quot;</span>
      <span class="ruby-value">:retry</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># Record</span>
  <span class="ruby-comment"># * `record`</span>
  <span class="ruby-comment">#   * Show recording status.</span>
  <span class="ruby-comment"># * `record [on|off]`</span>
  <span class="ruby-comment">#   * Start/Stop recording.</span>
  <span class="ruby-comment"># * `step back`</span>
  <span class="ruby-comment">#   * Start replay. Step back with the last execution log.</span>
  <span class="ruby-comment">#   * `s[tep]` does stepping forward with the last log.</span>
  <span class="ruby-comment"># * `step reset`</span>
  <span class="ruby-comment">#   * Stop replay .</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;record&#39;</span>, <span class="ruby-value">postmortem:</span> <span class="ruby-keyword">false</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">arg</span>
    <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>, <span class="ruby-string">&#39;on&#39;</span>, <span class="ruby-string">&#39;off&#39;</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:record</span>, <span class="ruby-identifier">arg</span>&amp;.<span class="ruby-identifier">to_sym</span>]
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;unknown command: #{arg}&quot;</span>
      <span class="ruby-value">:retry</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment">### Thread control</span>

  <span class="ruby-comment"># * `th[read]`</span>
  <span class="ruby-comment">#   * Show all threads.</span>
  <span class="ruby-comment"># * `th[read] &lt;thnum&gt;`</span>
  <span class="ruby-comment">#   * Switch thread specified by `&lt;thnum&gt;`.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;th&#39;</span>, <span class="ruby-string">&#39;thread&#39;</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">arg</span>
    <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>, <span class="ruby-string">&#39;list&#39;</span>, <span class="ruby-string">&#39;l&#39;</span>
      <span class="ruby-identifier">thread_list</span>
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/(\d+)/</span>
      <span class="ruby-identifier">switch_thread</span> <span class="ruby-node">$1</span>.<span class="ruby-identifier">to_i</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;unknown thread command: #{arg}&quot;</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-value">:retry</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment">### Configuration</span>
  <span class="ruby-comment"># * `config`</span>
  <span class="ruby-comment">#   * Show all configuration with description.</span>
  <span class="ruby-comment"># * `config &lt;name&gt;`</span>
  <span class="ruby-comment">#   * Show current configuration of &lt;name&gt;.</span>
  <span class="ruby-comment"># * `config set &lt;name&gt; &lt;val&gt;` or `config &lt;name&gt; = &lt;val&gt;`</span>
  <span class="ruby-comment">#   * Set &lt;name&gt; to &lt;val&gt;.</span>
  <span class="ruby-comment"># * `config append &lt;name&gt; &lt;val&gt;` or `config &lt;name&gt; &lt;&lt; &lt;val&gt;`</span>
  <span class="ruby-comment">#   * Append `&lt;val&gt;` to `&lt;name&gt;` if it is an array.</span>
  <span class="ruby-comment"># * `config unset &lt;name&gt;`</span>
  <span class="ruby-comment">#   * Set &lt;name&gt; to default.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;config&#39;</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">config_command</span> <span class="ruby-identifier">arg</span>
    <span class="ruby-value">:retry</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `source &lt;file&gt;`</span>
  <span class="ruby-comment">#   * Evaluate lines in `&lt;file&gt;` as debug commands.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;source&#39;</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span>
      <span class="ruby-keyword">begin</span>
        <span class="ruby-identifier">cmds</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">readlines</span>(<span class="ruby-identifier">path</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">arg</span>))
        <span class="ruby-identifier">add_preset_commands</span> <span class="ruby-identifier">path</span>, <span class="ruby-identifier">cmds</span>, <span class="ruby-value">kick:</span> <span class="ruby-keyword">true</span>, <span class="ruby-value">continue:</span> <span class="ruby-keyword">false</span>
      <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ENOENT</span>
        <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;File not found: #{arg}&quot;</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">show_help</span> <span class="ruby-string">&#39;source&#39;</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-value">:retry</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment"># * `open`</span>
  <span class="ruby-comment">#   * open debuggee port on UNIX domain socket and wait for attaching.</span>
  <span class="ruby-comment">#   * Note that `open` command is EXPERIMENTAL.</span>
  <span class="ruby-comment"># * `open [&lt;host&gt;:]&lt;port&gt;`</span>
  <span class="ruby-comment">#   * open debuggee port on TCP/IP with given `[&lt;host&gt;:]&lt;port&gt;` and wait for attaching.</span>
  <span class="ruby-comment"># * `open vscode`</span>
  <span class="ruby-comment">#   * open debuggee port for VSCode and launch VSCode if available.</span>
  <span class="ruby-comment"># * `open chrome`</span>
  <span class="ruby-comment">#   * open debuggee port for Chrome and wait for attaching.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;open&#39;</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">arg</span>&amp;.<span class="ruby-identifier">downcase</span>
    <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;&#39;</span>, <span class="ruby-keyword">nil</span>
      <span class="ruby-operator">::</span><span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">open</span> <span class="ruby-value">nonstop:</span> <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A(\d+)z/</span>
      <span class="ruby-operator">::</span><span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">open_tcp</span> <span class="ruby-value">host:</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">port:</span> <span class="ruby-node">$1</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-value">nonstop:</span> <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A(.+):(\d+)\z/</span>
      <span class="ruby-operator">::</span><span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">open_tcp</span> <span class="ruby-value">host:</span> <span class="ruby-node">$1</span>, <span class="ruby-value">port:</span> <span class="ruby-node">$2</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-value">nonstop:</span> <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;tcp&#39;</span>
      <span class="ruby-operator">::</span><span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">open_tcp</span> <span class="ruby-value">host:</span> <span class="ruby-constant">CONFIG</span>[<span class="ruby-value">:host</span>], <span class="ruby-value">port:</span> (<span class="ruby-constant">CONFIG</span>[<span class="ruby-value">:port</span>] <span class="ruby-operator">||</span> <span class="ruby-value">0</span>), <span class="ruby-value">nonstop:</span> <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;vscode&#39;</span>
      <span class="ruby-constant">CONFIG</span>[<span class="ruby-value">:open</span>] = <span class="ruby-string">&#39;vscode&#39;</span>
      <span class="ruby-operator">::</span><span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">open</span> <span class="ruby-value">nonstop:</span> <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;chrome&#39;</span>, <span class="ruby-string">&#39;cdp&#39;</span>
      <span class="ruby-constant">CONFIG</span>[<span class="ruby-value">:open</span>] = <span class="ruby-string">&#39;chrome&#39;</span>
      <span class="ruby-operator">::</span><span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">open_tcp</span> <span class="ruby-value">host:</span> <span class="ruby-constant">CONFIG</span>[<span class="ruby-value">:host</span>], <span class="ruby-value">port:</span> (<span class="ruby-constant">CONFIG</span>[<span class="ruby-value">:port</span>] <span class="ruby-operator">||</span> <span class="ruby-value">0</span>), <span class="ruby-value">nonstop:</span> <span class="ruby-keyword">true</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Unknown arg: #{arg}&quot;</span>
    <span class="ruby-keyword">end</span>

    <span class="ruby-value">:retry</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-comment">### Help</span>

  <span class="ruby-comment"># * `h[elp]`</span>
  <span class="ruby-comment">#   * Show help for all commands.</span>
  <span class="ruby-comment"># * `h[elp] &lt;command&gt;`</span>
  <span class="ruby-comment">#   * Show help for the given command.</span>
  <span class="ruby-identifier">register_command</span> <span class="ruby-string">&#39;h&#39;</span>, <span class="ruby-string">&#39;help&#39;</span>, <span class="ruby-string">&#39;?&#39;</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">arg</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">show_help</span> <span class="ruby-identifier">arg</span>
    <span class="ruby-value">:retry</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-register_var" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">register_var</span><span
                                class="method-args">(v, tid)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="register_var-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_dap.rb, line 752</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">register_var</span> <span class="ruby-identifier">v</span>, <span class="ruby-identifier">tid</span>
  <span class="ruby-keyword">if</span> (<span class="ruby-identifier">tl_vid</span> = <span class="ruby-identifier">v</span>[<span class="ruby-value">:variablesReference</span>]) <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
    <span class="ruby-identifier">vid</span> = <span class="ruby-ivar">@var_map</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
    <span class="ruby-ivar">@var_map</span>[<span class="ruby-identifier">vid</span>] = [<span class="ruby-value">:variable</span>, <span class="ruby-identifier">tid</span>, <span class="ruby-identifier">tl_vid</span>]
    <span class="ruby-identifier">v</span>[<span class="ruby-value">:variablesReference</span>] = <span class="ruby-identifier">vid</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-register_vars" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">register_vars</span><span
                                class="method-args">(vars, tid)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="register_vars-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/server_dap.rb, line 760</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">register_vars</span> <span class="ruby-identifier">vars</span>, <span class="ruby-identifier">tid</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-identifier">tid</span>.<span class="ruby-identifier">inspect</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tid</span>.<span class="ruby-identifier">kind_of?</span>(<span class="ruby-constant">Integer</span>)
  <span class="ruby-identifier">vars</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">register_var</span> <span class="ruby-identifier">v</span>, <span class="ruby-identifier">tid</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-rehash_bps" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">rehash_bps</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="rehash_bps-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1370</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">rehash_bps</span>
  <span class="ruby-identifier">bps</span> = <span class="ruby-ivar">@bps</span>.<span class="ruby-identifier">values</span>
  <span class="ruby-ivar">@bps</span>.<span class="ruby-identifier">clear</span>
  <span class="ruby-identifier">bps</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">bp</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">add_bp</span> <span class="ruby-identifier">bp</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-remote-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">remote?</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="remote-3F-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 154</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">remote?</span>
  <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">remote?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-repl_add_breakpoint" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">repl_add_breakpoint</span><span
                                class="method-args">(arg)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="repl_add_breakpoint-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1442</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">repl_add_breakpoint</span> <span class="ruby-identifier">arg</span>
  <span class="ruby-identifier">expr</span> = <span class="ruby-identifier">parse_break</span> <span class="ruby-string">&#39;break&#39;</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">strip</span>
  <span class="ruby-identifier">cond</span> = <span class="ruby-identifier">expr</span>[<span class="ruby-value">:if</span>]
  <span class="ruby-identifier">cmd</span>  = <span class="ruby-identifier">expr</span>[<span class="ruby-value">:cmd</span>]
  <span class="ruby-identifier">path</span> = <span class="ruby-identifier">expr</span>[<span class="ruby-value">:path</span>]

  <span class="ruby-keyword">case</span> <span class="ruby-identifier">expr</span>[<span class="ruby-value">:sig</span>]
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A(\d+)\z/</span>
    <span class="ruby-identifier">add_line_breakpoint</span> <span class="ruby-ivar">@tc</span>.<span class="ruby-identifier">location</span>.<span class="ruby-identifier">path</span>, <span class="ruby-node">$1</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-value">cond:</span> <span class="ruby-identifier">cond</span>, <span class="ruby-value">command:</span> <span class="ruby-identifier">cmd</span>
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A(.+)[:\s+](\d+)\z/</span>
    <span class="ruby-identifier">add_line_breakpoint</span> <span class="ruby-node">$1</span>, <span class="ruby-node">$2</span>.<span class="ruby-identifier">to_i</span>, <span class="ruby-value">cond:</span> <span class="ruby-identifier">cond</span>, <span class="ruby-value">command:</span> <span class="ruby-identifier">cmd</span>
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A(.+)([\.\#])(.+)\z/</span>
    <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:breakpoint</span>, <span class="ruby-value">:method</span>, <span class="ruby-node">$1</span>, <span class="ruby-node">$2</span>, <span class="ruby-node">$3</span>, <span class="ruby-identifier">cond</span>, <span class="ruby-identifier">cmd</span>, <span class="ruby-identifier">path</span>]
    <span class="ruby-keyword">return</span> <span class="ruby-value">:noretry</span>
  <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>
    <span class="ruby-identifier">add_check_breakpoint</span> <span class="ruby-identifier">cond</span>, <span class="ruby-identifier">path</span>, <span class="ruby-identifier">cmd</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Unknown breakpoint format: #{arg}&quot;</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span>
    <span class="ruby-identifier">show_help</span> <span class="ruby-string">&#39;b&#39;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-repl_add_catch_breakpoint" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">repl_add_catch_breakpoint</span><span
                                class="method-args">(arg)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="repl_add_catch_breakpoint-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1465</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">repl_add_catch_breakpoint</span> <span class="ruby-identifier">arg</span>
  <span class="ruby-identifier">expr</span> = <span class="ruby-identifier">parse_break</span> <span class="ruby-string">&#39;catch&#39;</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">strip</span>
  <span class="ruby-identifier">cond</span> = <span class="ruby-identifier">expr</span>[<span class="ruby-value">:if</span>]
  <span class="ruby-identifier">cmd</span>  = <span class="ruby-identifier">expr</span>[<span class="ruby-value">:cmd</span>]
  <span class="ruby-identifier">path</span> = <span class="ruby-identifier">expr</span>[<span class="ruby-value">:path</span>]

  <span class="ruby-identifier">bp</span> = <span class="ruby-constant">CatchBreakpoint</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">expr</span>[<span class="ruby-value">:sig</span>], <span class="ruby-value">cond:</span> <span class="ruby-identifier">cond</span>, <span class="ruby-value">command:</span> <span class="ruby-identifier">cmd</span>, <span class="ruby-value">path:</span> <span class="ruby-identifier">path</span>)
  <span class="ruby-identifier">add_bp</span> <span class="ruby-identifier">bp</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-repl_add_watch_breakpoint" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">repl_add_watch_breakpoint</span><span
                                class="method-args">(arg)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="repl_add_watch_breakpoint-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1475</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">repl_add_watch_breakpoint</span> <span class="ruby-identifier">arg</span>
  <span class="ruby-identifier">expr</span> = <span class="ruby-identifier">parse_break</span> <span class="ruby-string">&#39;watch&#39;</span>, <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">strip</span>
  <span class="ruby-identifier">cond</span> = <span class="ruby-identifier">expr</span>[<span class="ruby-value">:if</span>]
  <span class="ruby-identifier">cmd</span>  = <span class="ruby-identifier">expr</span>[<span class="ruby-value">:cmd</span>]
  <span class="ruby-identifier">path</span> = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">compile</span>(<span class="ruby-identifier">expr</span>[<span class="ruby-value">:path</span>]) <span class="ruby-keyword">if</span> <span class="ruby-identifier">expr</span>[<span class="ruby-value">:path</span>]

  <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:breakpoint</span>, <span class="ruby-value">:watch</span>, <span class="ruby-identifier">expr</span>[<span class="ruby-value">:sig</span>], <span class="ruby-identifier">cond</span>, <span class="ruby-identifier">cmd</span>, <span class="ruby-identifier">path</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-request_eval" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">request_eval</span><span
                                class="method-args">(type, src)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="request_eval-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1167</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">request_eval</span> <span class="ruby-identifier">type</span>, <span class="ruby-identifier">src</span>
  <span class="ruby-identifier">restart_all_threads</span>
  <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:eval</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">src</span>]
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-request_tc" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">request_tc</span><span
                                class="method-args">(req)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="request_tc-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 255</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">request_tc</span>(<span class="ruby-identifier">req</span>)
  <span class="ruby-ivar">@tc</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">req</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-reset_ui" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">reset_ui</span><span
                                class="method-args">(ui)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="reset_ui-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 228</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">reset_ui</span> <span class="ruby-identifier">ui</span>
  <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">deactivate</span>
  <span class="ruby-ivar">@ui</span> = <span class="ruby-identifier">ui</span>

  <span class="ruby-comment"># activate new ui</span>
  <span class="ruby-ivar">@tp_thread_begin</span>.<span class="ruby-identifier">disable</span>
  <span class="ruby-ivar">@tp_thread_end</span>.<span class="ruby-identifier">disable</span>
  <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">activate</span> <span class="ruby-keyword">self</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-value">:reader_thread</span>) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">thc</span> = <span class="ruby-identifier">get_thread_client</span>(<span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">reader_thread</span>)
    <span class="ruby-identifier">thc</span>.<span class="ruby-identifier">mark_as_management</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-ivar">@tp_thread_begin</span>.<span class="ruby-identifier">enable</span>
  <span class="ruby-ivar">@tp_thread_end</span>.<span class="ruby-identifier">enable</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-resolve_path" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">resolve_path</span><span
                                class="method-args">(file)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="resolve_path-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1762</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">resolve_path</span> <span class="ruby-identifier">file</span>
  <span class="ruby-constant">File</span>.<span class="ruby-identifier">realpath</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">expand_path</span>(<span class="ruby-identifier">file</span>))
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ENOENT</span>
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">file</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">&#39;-e&#39;</span>, <span class="ruby-string">&#39;-&#39;</span>
    <span class="ruby-keyword">return</span> <span class="ruby-identifier">file</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">$LOAD_PATH</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">lp</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">libpath</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">lp</span>, <span class="ruby-identifier">file</span>)
      <span class="ruby-keyword">return</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">realpath</span>(<span class="ruby-identifier">libpath</span>)
    <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Errno</span><span class="ruby-operator">::</span><span class="ruby-constant">ENOENT</span>
      <span class="ruby-comment"># next</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">raise</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-save_int_trap" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">save_int_trap</span><span
                                class="method-args">(cmd)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="save_int_trap-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1953</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">save_int_trap</span> <span class="ruby-identifier">cmd</span>
  <span class="ruby-identifier">prev</span>, <span class="ruby-ivar">@intercepted_sigint_cmd</span> = <span class="ruby-ivar">@intercepted_sigint_cmd</span>, <span class="ruby-identifier">cmd</span>
  <span class="ruby-identifier">prev</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-session_server_main" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">session_server_main</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="session_server_main-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 247</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">session_server_main</span>
  <span class="ruby-keyword">while</span> <span class="ruby-identifier">evt</span> = <span class="ruby-identifier">pop_event</span>
    <span class="ruby-identifier">process_event</span> <span class="ruby-identifier">evt</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-identifier">deactivate</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-set_no_sigint_hook" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">set_no_sigint_hook</span><span
                                class="method-args">(old, new)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="set_no_sigint_hook-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1942</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">set_no_sigint_hook</span> <span class="ruby-identifier">old</span>, <span class="ruby-identifier">new</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">old</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">new</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">unless</span> <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">respond_to?</span> <span class="ruby-value">:activate_sigint</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">old</span> <span class="ruby-comment"># no -&gt; yes</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">activate_sigint</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">deactivate_sigint</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-setup_threads" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">setup_threads</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="setup_threads-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1600</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">setup_threads</span>
  <span class="ruby-identifier">prev_clients</span> = <span class="ruby-ivar">@th_clients</span>
  <span class="ruby-ivar">@th_clients</span> = {}

  <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">list</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">th</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">tc</span> = <span class="ruby-identifier">prev_clients</span>[<span class="ruby-identifier">th</span>]
      <span class="ruby-ivar">@th_clients</span>[<span class="ruby-identifier">th</span>] = <span class="ruby-identifier">tc</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">create_thread_client</span>(<span class="ruby-identifier">th</span>)
    <span class="ruby-keyword">end</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show_bps" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show_bps</span><span
                                class="method-args">(specific_bp = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="show_bps-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1355</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show_bps</span> <span class="ruby-identifier">specific_bp</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">iterate_bps</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">bp</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;#%d %s&quot;</span> <span class="ruby-operator">%</span> [<span class="ruby-identifier">i</span>, <span class="ruby-identifier">bp</span>.<span class="ruby-identifier">to_s</span>] <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">specific_bp</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">bp</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">specific_bp</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-show_help" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">show_help</span><span
                                class="method-args">(arg = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="show_help-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1280</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">show_help</span> <span class="ruby-identifier">arg</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">instructions</span> = (<span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">commands</span>.<span class="ruby-identifier">keys</span> <span class="ruby-operator">+</span> <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">commands</span>.<span class="ruby-identifier">values</span>).<span class="ruby-identifier">uniq</span>
  <span class="ruby-identifier">print_instructions</span> = <span class="ruby-identifier">proc</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">desc</span><span class="ruby-operator">|</span>
    <span class="ruby-identifier">desc</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot;\n&quot;</span>).<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">line</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-string">&quot; &quot;</span>) <span class="ruby-comment"># workaround for step back</span>
      <span class="ruby-identifier">formatted_line</span> = <span class="ruby-identifier">line</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/[\[\]\*]/</span>, <span class="ruby-string">&quot;&quot;</span>).<span class="ruby-identifier">strip</span>
      <span class="ruby-identifier">instructions</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">inst</span><span class="ruby-operator">|</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">formatted_line</span>.<span class="ruby-identifier">start_with?</span>(<span class="ruby-node">&quot;`#{inst}&quot;</span>)
          <span class="ruby-identifier">desc</span>.<span class="ruby-identifier">sub!</span>(<span class="ruby-identifier">line</span>, <span class="ruby-identifier">colorize</span>(<span class="ruby-identifier">line</span>, [<span class="ruby-value">:CYAN</span>, <span class="ruby-value">:BOLD</span>]))
        <span class="ruby-keyword">end</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">end</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">desc</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">print_category</span> = <span class="ruby-identifier">proc</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">cat</span><span class="ruby-operator">|</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;\n&quot;</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-identifier">colorize</span>(<span class="ruby-node">&quot;### #{cat}&quot;</span>, [<span class="ruby-value">:GREEN</span>, <span class="ruby-value">:BOLD</span>])
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;\n&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">helps</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">cat</span>, <span class="ruby-identifier">cs</span><span class="ruby-operator">|</span>
    <span class="ruby-comment"># categories</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">nil?</span>
      <span class="ruby-identifier">print_category</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">cat</span>)
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">cs</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">ws</span>, <span class="ruby-identifier">_</span><span class="ruby-operator">|</span>
        <span class="ruby-keyword">if</span> <span class="ruby-identifier">ws</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">arg</span>)
          <span class="ruby-identifier">print_category</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">cat</span>)
          <span class="ruby-keyword">break</span>
        <span class="ruby-keyword">end</span>
      }
    <span class="ruby-keyword">end</span>

    <span class="ruby-comment"># instructions</span>
    <span class="ruby-identifier">cs</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">ws</span>, <span class="ruby-identifier">desc</span><span class="ruby-operator">|</span>
      <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">nil?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">ws</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">arg</span>)
        <span class="ruby-identifier">print_instructions</span>.<span class="ruby-identifier">call</span>(<span class="ruby-identifier">desc</span>.<span class="ruby-identifier">dup</span>)
        <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span>
      <span class="ruby-keyword">end</span>
    }
  }

  <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;not found: #{arg}&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">arg</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-source" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">source</span><span
                                class="method-args">(iseq)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="source-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 374</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">source</span> <span class="ruby-identifier">iseq</span>
  <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-constant">CONFIG</span>[<span class="ruby-value">:no_color</span>]
    <span class="ruby-ivar">@sr</span>.<span class="ruby-identifier">get_colored</span>(<span class="ruby-identifier">iseq</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@sr</span>.<span class="ruby-identifier">get</span>(<span class="ruby-identifier">iseq</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-step_command" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">step_command</span><span
                                class="method-args">(type, arg)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="step_command-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1172</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">step_command</span> <span class="ruby-identifier">type</span>, <span class="ruby-identifier">arg</span>
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:until</span>
    <span class="ruby-identifier">leave_subsession</span> [<span class="ruby-value">:step</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">arg</span>]
    <span class="ruby-keyword">return</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">case</span> <span class="ruby-identifier">arg</span>
  <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>, <span class="ruby-regexp">/\A\d+\z/</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">==</span> <span class="ruby-value">:in</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@tc</span>.<span class="ruby-identifier">recorder</span>&amp;.<span class="ruby-identifier">replaying?</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:step</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">arg</span>&amp;.<span class="ruby-identifier">to_i</span>]
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">leave_subsession</span> [<span class="ruby-value">:step</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">arg</span>&amp;.<span class="ruby-identifier">to_i</span>]
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">/\A(back)\z/</span>, <span class="ruby-regexp">/\A(back)\s+(\d+)\z/</span>, <span class="ruby-regexp">/\A(reset)\z/</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">type</span> <span class="ruby-operator">!=</span> <span class="ruby-value">:in</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;only `step #{arg}` is supported.&quot;</span>
      <span class="ruby-value">:retry</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">type</span> = <span class="ruby-node">$1</span>.<span class="ruby-identifier">to_sym</span>
      <span class="ruby-identifier">iter</span> = <span class="ruby-node">$2</span>&amp;.<span class="ruby-identifier">to_i</span>
      <span class="ruby-identifier">request_tc</span> [<span class="ruby-value">:step</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">iter</span>]
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Unknown option: #{arg}&quot;</span>
    <span class="ruby-value">:retry</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-stop_stepping-3F" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">stop_stepping?</span><span
                                class="method-args">(file, line, subsession_id = nil)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="stop_stepping-3F-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 158</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">stop_stepping?</span> <span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span>, <span class="ruby-identifier">subsession_id</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@bps</span>.<span class="ruby-identifier">has_key?</span> [<span class="ruby-identifier">file</span>, <span class="ruby-identifier">line</span>]
    <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">elsif</span> <span class="ruby-identifier">subsession_id</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-ivar">@subsession_id</span> <span class="ruby-operator">!=</span> <span class="ruby-identifier">subsession_id</span>
    <span class="ruby-keyword">true</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">false</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-switch_thread" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">switch_thread</span><span
                                class="method-args">(n)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="switch_thread-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1587</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">switch_thread</span> <span class="ruby-identifier">n</span>
  <span class="ruby-identifier">thcs</span>, <span class="ruby-identifier">_unmanaged_ths</span> = <span class="ruby-identifier">update_thread_list</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">tc</span> = <span class="ruby-identifier">thcs</span>[<span class="ruby-identifier">n</span>]
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">tc</span>.<span class="ruby-identifier">waiting?</span>
      <span class="ruby-ivar">@tc</span> = <span class="ruby-identifier">tc</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;#{tc.thread} is not controllable yet.&quot;</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">thread_list</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-thread_list" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">thread_list</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="thread_list-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1568</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">thread_list</span>
  <span class="ruby-identifier">thcs</span>, <span class="ruby-identifier">unmanaged_ths</span> = <span class="ruby-identifier">update_thread_list</span>
  <span class="ruby-identifier">thcs</span>.<span class="ruby-identifier">each_with_index</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">thc</span>, <span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;#{@tc == thc ? &quot;--&gt; &quot; : &quot;    &quot;}\##{i} #{thc}&quot;</span>
  }

  <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">unmanaged_ths</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;The following threads are not managed yet by the debugger:&quot;</span>
    <span class="ruby-identifier">unmanaged_ths</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">th</span><span class="ruby-operator">|</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;     &quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">th</span>.<span class="ruby-identifier">to_s</span>
    }
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-update_thread_list" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">update_thread_list</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              <p>threads</p>

                              <div class="method-source-code" id="update_thread_list-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1550</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">update_thread_list</span>
  <span class="ruby-identifier">list</span> = <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">list</span>
  <span class="ruby-identifier">thcs</span> = []
  <span class="ruby-identifier">unmanaged</span> = []

  <span class="ruby-identifier">list</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">th</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-identifier">thc</span> = <span class="ruby-ivar">@th_clients</span>[<span class="ruby-identifier">th</span>]
      <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-identifier">thc</span>.<span class="ruby-identifier">management?</span>
        <span class="ruby-identifier">thcs</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">thc</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">unmanaged</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">th</span>
    <span class="ruby-keyword">end</span>
  }

  <span class="ruby-keyword">return</span> <span class="ruby-identifier">thcs</span>.<span class="ruby-identifier">sort_by</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">thc</span><span class="ruby-operator">|</span> <span class="ruby-identifier">thc</span>.<span class="ruby-identifier">id</span>}, <span class="ruby-identifier">unmanaged</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-wait_command" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">wait_command</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="wait_command-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 410</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">wait_command</span>
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@preset_command</span>
    <span class="ruby-keyword">if</span> <span class="ruby-ivar">@preset_command</span>.<span class="ruby-identifier">commands</span>.<span class="ruby-identifier">empty?</span>
      <span class="ruby-keyword">if</span> <span class="ruby-ivar">@preset_command</span>.<span class="ruby-identifier">auto_continue</span>
        <span class="ruby-ivar">@preset_command</span> = <span class="ruby-keyword">nil</span>

        <span class="ruby-identifier">leave_subsession</span> <span class="ruby-value">:continue</span>
        <span class="ruby-keyword">return</span>
      <span class="ruby-keyword">else</span>
        <span class="ruby-ivar">@preset_command</span> = <span class="ruby-keyword">nil</span>
        <span class="ruby-keyword">return</span> <span class="ruby-value">:retry</span>
      <span class="ruby-keyword">end</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">line</span> = <span class="ruby-ivar">@preset_command</span>.<span class="ruby-identifier">commands</span>.<span class="ruby-identifier">shift</span>
      <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;(rdbg:#{@preset_command.source}) #{line}&quot;</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;INTERNAL_INFO: #{JSON.generate(@internal_info)}&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-constant">ENV</span>[<span class="ruby-string">&#39;RUBY_DEBUG_TEST_UI&#39;</span>] <span class="ruby-operator">==</span> <span class="ruby-string">&#39;terminal&#39;</span>
    <span class="ruby-identifier">line</span> = <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">readline</span> <span class="ruby-identifier">prompt</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">case</span> <span class="ruby-identifier">line</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span>
    <span class="ruby-identifier">process_command</span> <span class="ruby-identifier">line</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">Hash</span>
    <span class="ruby-identifier">process_protocol_request</span> <span class="ruby-identifier">line</span> <span class="ruby-comment"># defined in server.rb</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;unexpected input: #{line.inspect}&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-wait_command_loop" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">wait_command_loop</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="wait_command_loop-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 386</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">wait_command_loop</span>
  <span class="ruby-identifier">loop</span> <span class="ruby-keyword">do</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">wait_command</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:retry</span>
      <span class="ruby-comment"># nothing</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-keyword">break</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Interrupt</span>
    <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;\n^C&quot;</span>
    <span class="ruby-keyword">retry</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-width" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">width</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="width-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1847</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">width</span>
  <span class="ruby-ivar">@ui</span>.<span class="ruby-identifier">width</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

                <section id="private-instance-5Buntitled-5D-method-details" class="method-section">
                <header>
                <h3>Private Instance Methods</h3>
                </header>

                  <div id="method-i-ask_thread_client" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">ask_thread_client</span><span
                                class="method-args">(th)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="ask_thread_client-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1627</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">ask_thread_client</span> <span class="ruby-identifier">th</span>
  <span class="ruby-comment"># TODO: Ractor support</span>
  <span class="ruby-identifier">q2</span> = <span class="ruby-constant">Queue</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-comment"># tc, output, ev, @internal_info, *ev_args = evt</span>
  <span class="ruby-ivar">@q_evt</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-keyword">nil</span>, [], <span class="ruby-value">:thread_begin</span>, <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">th</span>, <span class="ruby-identifier">q2</span>]
  <span class="ruby-identifier">q2</span>.<span class="ruby-identifier">pop</span>

  <span class="ruby-ivar">@th_clients</span>[<span class="ruby-identifier">th</span>] <span class="ruby-keyword">or</span> <span class="ruby-identifier">raise</span> <span class="ruby-string">&quot;unexpected error&quot;</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-create_thread_client" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">create_thread_client</span><span
                                class="method-args">(th)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="create_thread_client-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1621</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">create_thread_client</span> <span class="ruby-identifier">th</span>
  <span class="ruby-comment"># TODO: Ractor support</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-string">&quot;Only session_server can create thread_client&quot;</span> <span class="ruby-keyword">unless</span> <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">current</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@session_server</span>
  <span class="ruby-ivar">@th_clients</span>[<span class="ruby-identifier">th</span>] = <span class="ruby-constant">ThreadClient</span>.<span class="ruby-identifier">new</span>((<span class="ruby-ivar">@tc_id</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>), <span class="ruby-ivar">@q_evt</span>, <span class="ruby-constant">Queue</span>.<span class="ruby-identifier">new</span>, <span class="ruby-identifier">th</span>)
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-enter_subsession" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">enter_subsession</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="enter_subsession-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1695</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">enter_subsession</span>
  <span class="ruby-ivar">@subsession_id</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
  <span class="ruby-keyword">if</span> <span class="ruby-operator">!</span><span class="ruby-ivar">@subsession_stack</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">debug</span>{ <span class="ruby-node">&quot;Enter subsession (nested #{@subsession_stack.size})&quot;</span> }
  <span class="ruby-keyword">else</span>
    <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">debug</span>{ <span class="ruby-string">&quot;Enter subsession&quot;</span> }
    <span class="ruby-identifier">stop_all_threads</span>
    <span class="ruby-ivar">@process_group</span>.<span class="ruby-identifier">lock</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@subsession_stack</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-leave_subsession" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">leave_subsession</span><span
                                class="method-args">(type)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="leave_subsession-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1708</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">leave_subsession</span> <span class="ruby-identifier">type</span>
  <span class="ruby-identifier">raise</span> <span class="ruby-string">&#39;[BUG] leave_subsession: not entered&#39;</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@subsession_stack</span>.<span class="ruby-identifier">empty?</span>
  <span class="ruby-ivar">@subsession_stack</span>.<span class="ruby-identifier">pop</span>

  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@subsession_stack</span>.<span class="ruby-identifier">empty?</span>
    <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">debug</span>{ <span class="ruby-string">&quot;Leave subsession&quot;</span> }
    <span class="ruby-ivar">@process_group</span>.<span class="ruby-identifier">unlock</span>
    <span class="ruby-identifier">restart_all_threads</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-constant">DEBUGGER__</span>.<span class="ruby-identifier">debug</span>{ <span class="ruby-node">&quot;Leave subsession (nested #{@subsession_stack.size})&quot;</span> }
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">request_tc</span> <span class="ruby-identifier">type</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">type</span>
  <span class="ruby-ivar">@tc</span> = <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> <span class="ruby-operator">=&gt;</span> <span class="ruby-identifier">e</span>
  <span class="ruby-constant">STDERR</span>.<span class="ruby-identifier">puts</span> <span class="ruby-constant">PP</span>.<span class="ruby-identifier">pp</span>([<span class="ruby-identifier">e</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">backtrace</span>], <span class="ruby-string">&#39;&#39;</span>.<span class="ruby-identifier">dup</span>)
  <span class="ruby-identifier">raise</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-parse_break" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">parse_break</span><span
                                class="method-args">(type, arg)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="parse_break-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1417</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">parse_break</span> <span class="ruby-identifier">type</span>, <span class="ruby-identifier">arg</span>
  <span class="ruby-identifier">mode</span> = <span class="ruby-value">:sig</span>
  <span class="ruby-identifier">expr</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">h</span>, <span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = []}
  <span class="ruby-identifier">arg</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">&#39; &#39;</span>).<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">w</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">if</span> <span class="ruby-constant">BREAK_KEYWORDS</span>.<span class="ruby-identifier">any?</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">pat</span><span class="ruby-operator">|</span> <span class="ruby-identifier">w</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">pat</span>}
      <span class="ruby-identifier">mode</span> = <span class="ruby-identifier">w</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">-2</span>].<span class="ruby-identifier">to_sym</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-identifier">expr</span>[<span class="ruby-identifier">mode</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">w</span>
    <span class="ruby-keyword">end</span>
  }
  <span class="ruby-identifier">expr</span>.<span class="ruby-identifier">default_proc</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-identifier">expr</span> = <span class="ruby-identifier">expr</span>.<span class="ruby-identifier">transform_values</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">v</span>.<span class="ruby-identifier">join</span>(<span class="ruby-string">&#39; &#39;</span>)}

  <span class="ruby-keyword">if</span> (<span class="ruby-identifier">path</span> = <span class="ruby-identifier">expr</span>[<span class="ruby-value">:path</span>]) <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">path</span> <span class="ruby-operator">=~</span> <span class="ruby-regexp">/\A\/(.*)\/\z/</span>
    <span class="ruby-identifier">expr</span>[<span class="ruby-value">:path</span>] = <span class="ruby-constant">Regexp</span>.<span class="ruby-identifier">compile</span>(<span class="ruby-node">$1</span>)
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">expr</span>[<span class="ruby-value">:do</span>] <span class="ruby-operator">||</span> <span class="ruby-identifier">expr</span>[<span class="ruby-value">:pre</span>]
    <span class="ruby-identifier">check_unsafe</span>
    <span class="ruby-identifier">expr</span>[<span class="ruby-value">:cmd</span>] = [<span class="ruby-identifier">type</span>, <span class="ruby-identifier">expr</span>[<span class="ruby-value">:pre</span>], <span class="ruby-identifier">expr</span>[<span class="ruby-value">:do</span>]]
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">expr</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-register_command" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">register_command</span><span
                                class="method-args">(*names, repeat: false, unsafe: true, cancel_auto_continue: false, postmortem: true, &amp;b)</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="register_command-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 441</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">register_command</span> <span class="ruby-operator">*</span><span class="ruby-identifier">names</span>,
                             <span class="ruby-value">repeat:</span> <span class="ruby-keyword">false</span>, <span class="ruby-value">unsafe:</span> <span class="ruby-keyword">true</span>, <span class="ruby-value">cancel_auto_continue:</span> <span class="ruby-keyword">false</span>, <span class="ruby-value">postmortem:</span> <span class="ruby-keyword">true</span>,
                             <span class="ruby-operator">&amp;</span><span class="ruby-identifier">b</span>
  <span class="ruby-identifier">cmd</span> = <span class="ruby-constant">SessionCommand</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">b</span>, <span class="ruby-identifier">repeat</span>, <span class="ruby-identifier">unsafe</span>, <span class="ruby-identifier">cancel_auto_continue</span>, <span class="ruby-identifier">postmortem</span>)

  <span class="ruby-identifier">names</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
    <span class="ruby-ivar">@commands</span>[<span class="ruby-identifier">name</span>] = <span class="ruby-identifier">cmd</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-restart_all_threads" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">restart_all_threads</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="restart_all_threads-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1685</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">restart_all_threads</span>
  <span class="ruby-identifier">stopper</span> = <span class="ruby-ivar">@thread_stopper</span>
  <span class="ruby-identifier">stopper</span>.<span class="ruby-identifier">disable</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">stopper</span>.<span class="ruby-identifier">enabled?</span>

  <span class="ruby-identifier">waiting_thread_clients</span>.<span class="ruby-identifier">each</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">tc</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-ivar">@tc</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">tc</span>
    <span class="ruby-identifier">tc</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-value">:continue</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-running_thread_clients_count" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">running_thread_clients_count</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="running_thread_clients_count-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1650</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">running_thread_clients_count</span>
  <span class="ruby-ivar">@th_clients</span>.<span class="ruby-identifier">count</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">th</span>, <span class="ruby-identifier">tc</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">tc</span>.<span class="ruby-identifier">management?</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tc</span>.<span class="ruby-identifier">running?</span>
    <span class="ruby-keyword">true</span>
  }
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-stop_all_threads" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">stop_all_threads</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="stop_all_threads-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1678</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">stop_all_threads</span>
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">running_thread_clients_count</span> <span class="ruby-operator">==</span> <span class="ruby-value">0</span>

  <span class="ruby-identifier">stopper</span> = <span class="ruby-ivar">@thread_stopper</span>
  <span class="ruby-identifier">stopper</span>.<span class="ruby-identifier">enable</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">stopper</span>.<span class="ruby-identifier">enabled?</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-thread_stopper" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">thread_stopper</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="thread_stopper-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1666</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">thread_stopper</span>
  <span class="ruby-constant">TracePoint</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">:line</span>) <span class="ruby-keyword">do</span>
    <span class="ruby-comment"># run on each thread</span>
    <span class="ruby-identifier">tc</span> = <span class="ruby-constant">ThreadClient</span>.<span class="ruby-identifier">current</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">tc</span>.<span class="ruby-identifier">management?</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tc</span>.<span class="ruby-identifier">running?</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">tc</span> <span class="ruby-operator">==</span> <span class="ruby-ivar">@tc</span>

    <span class="ruby-identifier">tc</span>.<span class="ruby-identifier">on_pause</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                  <div id="method-i-waiting_thread_clients" class="method-detail ">
                            <div class="method-heading">
                              <span class="method-name">waiting_thread_clients</span><span
                                class="method-args">()</span>
                              <span class="method-click-advice">click to toggle source</span>
                            </div>

                            <div class="method-description">
                              

                              <div class="method-source-code" id="waiting_thread_clients-source">
            <pre><span class="ruby-comment"># File debug-1.8.0/lib/debug/session.rb, line 1658</span>
        <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">waiting_thread_clients</span>
  <span class="ruby-ivar">@th_clients</span>.<span class="ruby-identifier">map</span>{<span class="ruby-operator">|</span><span class="ruby-identifier">th</span>, <span class="ruby-identifier">tc</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">tc</span>.<span class="ruby-identifier">management?</span>
    <span class="ruby-keyword">next</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">tc</span>.<span class="ruby-identifier">waiting?</span>
    <span class="ruby-identifier">tc</span>
  }.<span class="ruby-identifier">compact</span>
<span class="ruby-keyword">end</span></pre>
                              </div>
                            </div>


                          </div>

                          </section>

              </section>
              </main>



            </div>  <!--  class='wrapper hdiv' -->


<footer id="validator-badges" role="contentinfo">
<p><a href="https://validator.w3.org/check/referer">Validate</a></p>
<p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.4.0.</p>
<p>Based on <a href="https://github.com/ged/darkfish/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.</p>

  
    <p><p><a href="https://ruby-doc.org">Ruby-doc.org</a> is provided by <a href="https://jamesbritt.com">James Britt</a> and <a href="https://neurogami.com">Neurogami</a>.</p><p><a href="https://jamesbritt.bandcamp.com/">Maximum R+D</a>.  </p>
</p>
  
  </footer>

<script type="text/javascript">


  let ads  = $("#carbonads-container").children().detach();


  function swapMode() {
    var cookieName = 'darkmode';
    var cssDarkmode = Cookies.get(cookieName);
    console.log("***** swapMode! " + cssDarkmode + " *****");


    if (cssDarkmode == "true") {
      console.log("We have dark mode, set the css to light ...");
      $('#rdoccss').attr("href", defaultModeCssHref);
      $('#cssSelect').text("Dark mode");
      cssDarkmode = "false";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    } else {
      console.log("We not have dark mode, set the css to dark ...");
      $('#rdoccss').attr("href", darkModeCsseHref);
      $('#cssSelect').text("Light mode");
      cssDarkmode = "true";
      console.log("swapMode! Now set cookie to " + cssDarkmode);
      Cookies.set(cookieName, cssDarkmode);

    }

    console.log("  --------------- ");
  }


const vueCssApp = new Vue({
el: '#menubar',
data: {
isDark: false
},
methods: {
toggleClass: function(event){
this.isDark = !this.isDark;
}
}
})

const vueApp = new Vue({
el: '#vapp',
data: { 
isOpen: true
},

mounted() {
this.handleResize();
this.manage_mob_classes();
window.addEventListener('resize', this.handleResize)
//this.isOpen !=  (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},
destroyed() {
window.removeEventListener('resize', this.handleResize)
},
created() {
//manage_mob_classes();
},

methods : {
isMobile() {
  return (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent));
},

  handleResize() {
    if (!this.isMobile()) {
      this.isOpen = window.innerWidth > 800;
    }
  },

  manage_mob_classes() {
    if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
      $("nav").addClass("mob_nav");
      $("main").addClass("mob_main");
      $("#extraz").addClass("mob_extraz");
      $("#carbonads-container").addClass("mob_carbonads-container");
      this.isOpen  = false;
    } else {
      $("nav").removeClass("mob_nav") 
        $("main").removeClass("mob_main");
      $("#extraz").removeClass("mob_extraz");
      $("#carbonads-container").removeClass("mob_carbonads-container");
      this.isOpen  = true;
    }
  },

  toggleNav() {
    this.isOpen =! this.isOpen ;
    // alert("Toggle nav!");
    console.log("toggleNav() click: " + this.isOpen );
  }
}
})

$("#carbonads-container").append(ads);


$(function() {

    var darkmode = Cookies.get("darkmode");
    console.log("Document ready: " + darkmode);

    if ( darkmode  == "true" ) {
      $('#cssSelect').text("Light mode");
    } else {
      $('#cssSelect').text("Dark mode");
     }

    $('body').css('display','block');
    });

</script>

    
  </body> 
</html>

